Skip to content

Commit

Permalink
set config type
Browse files Browse the repository at this point in the history
  • Loading branch information
raulb committed Feb 5, 2025
1 parent 964e246 commit 195b39c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ func bindViperConfig(v *viper.Viper, cfg Config, cmd *cobra.Command) error {
v.AutomaticEnv()
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))

// Handle config file
v.SetConfigFile(cfg.Path)
v.SetConfigType("yaml")

// Handle config file
if err := v.ReadInConfig(); err != nil {
// we make the existence of the config file optional
if !os.IsNotExist(err) {
Expand Down

0 comments on commit 195b39c

Please sign in to comment.