From 870fecbdc356449752ff52251ce2b5409009aadf Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Sat, 7 Oct 2023 16:27:06 +0900 Subject: [PATCH] mark fail, mustExec and mustQuery as test helpers --- driver_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driver_test.go b/driver_test.go index dd3d73141..1fffad6d1 100644 --- a/driver_test.go +++ b/driver_test.go @@ -165,6 +165,7 @@ func runTests(t *testing.T, dsn string, tests ...func(dbt *DBTest)) { } func (dbt *DBTest) fail(method, query string, err error) { + dbt.Helper() if len(query) > 300 { query = "[query too large to print]" } @@ -172,6 +173,7 @@ func (dbt *DBTest) fail(method, query string, err error) { } func (dbt *DBTest) mustExec(query string, args ...interface{}) (res sql.Result) { + dbt.Helper() res, err := dbt.db.Exec(query, args...) if err != nil { dbt.fail("exec", query, err) @@ -180,6 +182,7 @@ func (dbt *DBTest) mustExec(query string, args ...interface{}) (res sql.Result) } func (dbt *DBTest) mustQuery(query string, args ...interface{}) (rows *sql.Rows) { + dbt.Helper() rows, err := dbt.db.Query(query, args...) if err != nil { dbt.fail("query", query, err)