diff --git a/cmd/commands/api/apiapp.go b/cmd/commands/api/apiapp.go index e1862be..2803fd3 100644 --- a/cmd/commands/api/apiapp.go +++ b/cmd/commands/api/apiapp.go @@ -511,7 +511,7 @@ import ( ) func init() { - _, file, _, _ := runtime.Caller(1) + _, file, _, _ := runtime.Caller(0) apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator)))) beego.TestBeegoInit(apppath) } diff --git a/cmd/commands/new/new.go b/cmd/commands/new/new.go index 299f094..120efa2 100644 --- a/cmd/commands/new/new.go +++ b/cmd/commands/new/new.go @@ -101,7 +101,7 @@ import ( ) func init() { - _, file, _, _ := runtime.Caller(1) + _, file, _, _ := runtime.Caller(0) apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".." + string(filepath.Separator)))) beego.TestBeegoInit(apppath) }