diff --git a/README.md b/README.md index 063c209..eeb48a1 100644 --- a/README.md +++ b/README.md @@ -447,7 +447,7 @@ bast.Run(":9999") "maxAge":"1728000", "allowCredentials":"true" }, - "conf":{//user config(non bast framework) + "conf":{//user config(non bast framework) such as db config "key":"app", "name":"xxx", "dbTitle":"xxx app", diff --git a/conf/conf.go b/conf/conf.go index d628752..cfa0cbc 100644 --- a/conf/conf.go +++ b/conf/conf.go @@ -60,18 +60,6 @@ type AppConf struct { initTag bool } -//Item default db config -type Item struct { - Name string `json:"name"` - Title string `json:"dbTitle"` - User string `json:"dbUser"` - Pwd string `json:"dbPwd"` - Server string `json:"dbServer"` - Charset string `json:"dbCharset"` - ParseTime *bool `json:"dbParseTime"` - Loc string `json:"dbLoc"` -} - //CORS config type CORS struct { AllowOrigin string `json:"allowOrigin"` @@ -180,9 +168,9 @@ func callbackHandle() { if lg == 0 { return } - for i := 0; i < lg; i++ { - c := &confObj.rawConfs[i] - if confHandle != nil { + if confHandle != nil { + for i := 0; i < lg; i++ { + c := &confObj.rawConfs[i] err := confHandle(c) if err != nil { logs.Errors("callback conf handle error", err)