Skip to content

Commit

Permalink
fix: use os instead
Browse files Browse the repository at this point in the history
  • Loading branch information
GoliathLabs committed Jan 2, 2024
1 parent 72198d1 commit b9930ff
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/serve/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package serve
import (
"context"
"fmt"
"io"
"net"
"net/http"
"net/netip"
Expand Down Expand Up @@ -302,7 +301,7 @@ func (cmd *servecmd) Run() {
// ReadConfig reads the config file from disk if specified and overrides any env vars or cmdline options
func (cmd *servecmd) ReadConfig() *config.AppConfig {
if cmd.ConfigFilePath != "" {
if b, err := io.ReadFile(cmd.ConfigFilePath); err == nil {
if b, err := os.ReadFile(cmd.ConfigFilePath); err == nil {
if err := yaml.Unmarshal(b, &cmd.AppConfig); err != nil {
logrus.Fatal(errors.Wrap(err, "failed to bind configuration file"))
}
Expand Down

0 comments on commit b9930ff

Please sign in to comment.