main
kzkzzzz 2024-06-23 14:24:25 +08:00
parent f17cf17e4f
commit ebf5c21cde
1 changed files with 9 additions and 1 deletions

View File

@ -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 {