Skip to content

Commit

Permalink
Fix when configuration file is missing
Browse files Browse the repository at this point in the history
viper.Unmarshal should run even if the configuration file is missing.
This is a fix for #488.
  • Loading branch information
noborus committed Jan 24, 2024
1 parent a1d7bb1 commit 879f450
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ func initConfig() {
var configNotFoundError *viper.ConfigFileNotFoundError
if !errors.As(err, &configNotFoundError) {
fmt.Fprintln(os.Stderr, "failed to read config file:", err)
return
// If the config file is not found, it is not an error and will continue.
}
}

Expand Down

0 comments on commit 879f450

Please sign in to comment.