2
0

Commit and Rollback take context

Remove Ex versions.
This commit is contained in:
Jack Christensen
2019-04-10 12:22:12 -05:00
parent 7718ee6207
commit 54c6ddc2f0
9 changed files with 32 additions and 45 deletions
+2 -2
View File
@@ -184,12 +184,12 @@ can create a transaction with a specified isolation level.
// the tx commits successfully, this is a no-op
defer tx.Rollback()
_, err = tx.Exec("insert into foo(id) values (1)")
_, err = tx.Exec(context.Background(), "insert into foo(id) values (1)")
if err != nil {
return err
}
err = tx.Commit()
err = tx.Commit(context.Background())
if err != nil {
return err
}