1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 10:50:39 +00:00

add check ineffect and gofmt

This commit is contained in:
astaxie
2017-04-28 21:38:08 +08:00
parent f311ae9ebe
commit 3e29078f68
6 changed files with 24 additions and 13 deletions

View File

@ -135,7 +135,7 @@ func getCaller(skip int) string {
if i := strings.LastIndex(funName, "."); i > -1 {
funName = funName[i+1:]
}
return fmt.Sprintf("%s:%d: \n%s", fn, line, strings.Join(codes, "\n"))
return fmt.Sprintf("%s:%s:%d: \n%s", fn, funName, line, strings.Join(codes, "\n"))
}
func throwFail(t *testing.T, err error, args ...interface{}) {
@ -1014,6 +1014,8 @@ func TestAll(t *testing.T) {
var users3 []*User
qs = dORM.QueryTable("user")
num, err = qs.Filter("user_name", "nothing").All(&users3)
throwFailNow(t, err)
throwFailNow(t, AssertIs(num, 0))
throwFailNow(t, AssertIs(users3 == nil, false))
}