1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 20:10:56 +00:00

accept @ysqi suggestion

This commit is contained in:
youngsterxyf 2016-01-27 13:30:34 +08:00
parent 321bcc606a
commit e357f6846b
2 changed files with 2 additions and 12 deletions

View File

@ -67,15 +67,6 @@ func Run(params ...string) {
} }
func initBeforeHTTPRun() { func initBeforeHTTPRun() {
// if AppConfigPath is setted or conf/app.conf exist
/*
err := ParseConfig()
if err != nil {
panic(err)
}
*/
var err error
//init hooks //init hooks
AddAPPStartHook(registerMime) AddAPPStartHook(registerMime)
AddAPPStartHook(registerDefaultErrorHandler) AddAPPStartHook(registerDefaultErrorHandler)
@ -85,7 +76,7 @@ func initBeforeHTTPRun() {
AddAPPStartHook(registerAdmin) AddAPPStartHook(registerAdmin)
for _, hk := range hooks { for _, hk := range hooks {
if err = hk(); err != nil { if err := hk(); err != nil {
panic(err) panic(err)
} }
} }

View File

@ -20,7 +20,6 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"fmt" "fmt"
"errors"
"github.com/astaxie/beego/config" "github.com/astaxie/beego/config"
"github.com/astaxie/beego/session" "github.com/astaxie/beego/session"
@ -320,7 +319,7 @@ func LoadAppConfig(configPath string, adapterName string) error {
} }
if !utils.FileExists(absConfigPath) { if !utils.FileExists(absConfigPath) {
return errors.New(fmt.Sprintf("the target config file: %s don't exist!", configPath)) return fmt.Errorf("the target config file: %s don't exist!", configPath)
} }
if absConfigPath == AppConfigPath { if absConfigPath == AppConfigPath {