silenced race detector errors per #7484

This commit is contained in:
Gani Georgiev
2026-01-28 11:52:08 +02:00
parent b2bf26122f
commit 0e0b862bd7
3 changed files with 24 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import (
"fmt"
"strconv"
"strings"
"sync"
"testing"
"time"
@@ -741,6 +742,7 @@ type testTableStruct struct {
type testDB struct {
*dbx.DB
mu sync.Mutex
CalledQueries []string
}
@@ -765,6 +767,8 @@ func createTestDB() (*testDB, error) {
db.Insert("test", dbx.Params{"id": 1, "test1": 1, "test2": "test2.1"}).Execute()
db.Insert("test", dbx.Params{"id": 2, "test1": 2, "test2": "test2.2"}).Execute()
db.QueryLogFunc = func(ctx context.Context, t time.Duration, sql string, rows *sql.Rows, err error) {
db.mu.Lock()
defer db.mu.Unlock()
db.CalledQueries = append(db.CalledQueries, sql)
}