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:
parent
27a0142864
commit
1032042472
12 changed files with 87 additions and 27 deletions
|
@ -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]{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue