@@ -7,13 +7,15 @@ import (
77 "testing"
88)
99
10+ type connCtxKey string
11+
1012const (
11- connRowContextKey = "context"
12- connRowContextValue = "value"
13- connStmtContextKey = "stmtcontext"
14- connStmtContextValue = "stmtvalue"
15- connTxContextKey = "txcontext"
16- connTxContextValue = "txvalue"
13+ connRowContextKey connCtxKey = "context"
14+ connRowContextValue string = "value"
15+ connStmtContextKey connCtxKey = "stmtcontext"
16+ connStmtContextValue string = "stmtvalue"
17+ connTxContextKey connCtxKey = "txcontext"
18+ connTxContextValue string = "txvalue"
1719)
1820
1921type connTestInterceptor struct {
@@ -204,12 +206,14 @@ func TestConnBeginTx_PassWrappedTxContextCommit(t *testing.T) {
204206 t .Fatalf ("Prepare failed: %s" , err )
205207 }
206208
207- tx .Commit ()
209+ err = tx .Commit ()
210+ if err != nil {
211+ t .Fatalf ("Commit failed: %s" , err )
212+ }
208213
209214 if ! ti .TxCommitValid {
210215 t .Error ("TxCommit context not valid" )
211216 }
212-
213217}
214218func TestConnBeginTx_PassWrappedTxContextRollback (t * testing.T ) {
215219 driverName := driverName (t )
@@ -241,7 +245,10 @@ func TestConnBeginTx_PassWrappedTxContextRollback(t *testing.T) {
241245 t .Fatalf ("Prepare failed: %s" , err )
242246 }
243247
244- tx .Rollback ()
248+ err = tx .Rollback ()
249+ if err != nil {
250+ t .Fatalf ("Rollback failed: %s" , err )
251+ }
245252
246253 if ! ti .TxRollbackValid {
247254 t .Error ("TxRollback context not valid" )
0 commit comments