diff --git a/myconf/conf.go b/myconf/conf.go index 33ddc5c..881fe23 100644 --- a/myconf/conf.go +++ b/myconf/conf.go @@ -20,7 +20,15 @@ func LoadFlag() { } } -func LoadFile(confFile string, conf interface{}) { +func LoadFile(confFile string) { + vp.SetConfigFile(confFile) + err := vp.ReadInConfig() + if err != nil { + panic(fmt.Errorf("read file fail: %s", err)) + } +} + +func LoadFileTo(confFile string, conf interface{}) { vp.SetConfigFile(confFile) err := vp.ReadInConfig() if err != nil {