Skip to content

Commit

Permalink
Merge pull request #239 from reski-rukmantiyo/master
Browse files Browse the repository at this point in the history
bugfix: will stop if config.yml is error
  • Loading branch information
xxjwxc authored Oct 22, 2024
2 parents 28be95f + 2501a18 commit a24458b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions data/config/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,21 @@ func init() {
}
}

onInit()
err := onInit()
if err != nil {
fmt.Println("Load config file error: ", err.Error())
panic(err)
}
dev.OnSetDev(_map.IsDev)
}

func onInit() {
func onInit() error {
err := InitFile(configPath)
if err != nil {
fmt.Println("Load config file error: ", err.Error())
return
return err
}
return nil
}

// InitFile default value from file .
Expand Down

0 comments on commit a24458b

Please sign in to comment.