mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
database/sql: fix possible context leak in test
Fixes #17560 Change-Id: I96fcdec87220391ef5432571b5c090b5be27491a Reviewed-on: https://go-review.googlesource.com/31771 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
accf5cc386
commit
0fff67d191
1 changed files with 1 additions and 0 deletions
|
|
@ -267,6 +267,7 @@ func TestQueryContext(t *testing.T) {
|
||||||
prepares0 := numPrepares(t, db)
|
prepares0 := numPrepares(t, db)
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
rows, err := db.QueryContext(ctx, "SELECT|people|age,name|")
|
rows, err := db.QueryContext(ctx, "SELECT|people|age,name|")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue