Skip to content

Commit

Permalink
Fix coniguration problem
Browse files Browse the repository at this point in the history
  • Loading branch information
RashadAnsari committed Jul 11, 2021
1 parent a629293 commit 6b05493
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func Init(app string, file string, cfg interface{}, defaultConfig string, prefix
return err
}

v.SetConfigFile(file)
v.SetConfigName(file)
v.SetEnvPrefix(prefix)
v.AddConfigPath(fmt.Sprintf("/etc/%s/", app))
v.AddConfigPath(fmt.Sprintf("$HOME/.%s", app))
Expand All @@ -29,6 +29,7 @@ func Init(app string, file string, cfg interface{}, defaultConfig string, prefix
switch err := v.MergeInConfig(); err.(type) {
case nil:
case *os.PathError:
fmt.Println(err.Error())
default:
return err
}
Expand Down

0 comments on commit 6b05493

Please sign in to comment.