From 19be52dc8cd771cfc50b64218204e4f0d9cc37ba Mon Sep 17 00:00:00 2001 From: Tavee Khunbida Date: Tue, 8 Jan 2019 00:34:51 +0700 Subject: [PATCH] Fix panic on running tests for newly generated project --- cmd/commands/api/apiapp.go | 2 +- cmd/commands/new/new.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) }