diff --git a/os/gcfg/gcfg.go b/os/gcfg/gcfg.go index 2c26abdf6..423b382df 100644 --- a/os/gcfg/gcfg.go +++ b/os/gcfg/gcfg.go @@ -73,14 +73,22 @@ func New(file ...string) *Config { } else { // Dir path of main package. if mainPath := gfile.MainPkgPath(); mainPath != "" && gfile.Exists(mainPath) { - _ = c.AddPath(mainPath) + if err := c.AddPath(mainPath); err != nil { + intlog.Error(err) + } } + + // Dir path of working dir. + if err := c.AddPath(gfile.Pwd()); err != nil { + intlog.Error(err) + } + // Dir path of binary. if selfPath := gfile.SelfDir(); selfPath != "" && gfile.Exists(selfPath) { - _ = c.AddPath(selfPath) + if err := c.AddPath(selfPath); err != nil { + intlog.Error(err) + } } - // Dir path of working dir. - _ = c.AddPath(gfile.Pwd()) } return c }