1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-06 13:26:24 -07:00

Fix changes suggested by sqlclosecheck

This commit is contained in:
Eggbertx 2024-05-24 16:10:07 -07:00
parent 27a0142864
commit 1032042472
12 changed files with 87 additions and 27 deletions

View file

@ -75,10 +75,15 @@ func tcPrepareContextSQL(t *testing.T, mock sqlmock.Sqlmock, tC *testCase[prepar
}
func TestPrepareContextSQL(t *testing.T) {
_, err := PrepareContextSQL(context.Background(), "", nil)
stmt, err := PrepareContextSQL(context.Background(), "", nil)
if !assert.Error(t, err) {
return
}
defer func() {
if stmt != nil {
assert.NoError(t, stmt.Close())
}
}()
mock := setupMockDB(t)
testCases := []testCase[prepareFunc]{