diff --git a/models/config.go b/models/config.go index 14228b4..a7d5335 100644 --- a/models/config.go +++ b/models/config.go @@ -9,12 +9,13 @@ import ( ) var ( - _, b, _, _ = runtime.Caller(0) - Root = filepath.Join(filepath.Dir(b), "..") - Viper *viper.Viper + Root string + Viper *viper.Viper ) func init() { + _, b, _, _ := runtime.Caller(0) + Root = filepath.Join(filepath.Dir(b), "..") config_file := filepath.Join(Root, "data", "config.yaml") viper.SetConfigFile(config_file) if err := viper.ReadInConfig(); err != nil {