From 6b05493390257e7c5d7266a2e372b11cf388fc72 Mon Sep 17 00:00:00 2001 From: Rashad Ansari Date: Sun, 11 Jul 2021 21:55:26 +0200 Subject: [PATCH] Fix coniguration problem --- pkg/config/config.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 54c5c3b..ab3369c 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -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)) @@ -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 }