Commit d1481ea6 authored by coseyo's avatar coseyo

move assignment to init

parent 09d3d89c
......@@ -113,9 +113,15 @@ var (
TemplateCache map[string]*template.Template
// GlobalSessions is the instance for the session manager
GlobalSessions *session.Manager
workPath string
)
func init() {
AppPath, _ = filepath.Abs(filepath.Dir(os.Args[0]))
workPath, _ = os.Getwd()
workPath, _ = filepath.Abs(workPath)
BConfig = &Config{
AppName: "beego",
RunMode: DEV,
......@@ -181,10 +187,6 @@ func init() {
// ParseConfig parsed default config file.
// now only support ini, next will support json.
func ParseConfig() (err error) {
AppPath, _ := filepath.Abs(filepath.Dir(os.Args[0]))
workPath, _ := os.Getwd()
workPath, _ = filepath.Abs(workPath)
if AppConfigPath == "" {
// initialize default configurations
AppConfigPath = filepath.Join(AppPath, "conf", "app.conf")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment