Skip to content

Commit b9dca1b

Browse files
committed
database/sql: fix ctx.Done() == nil check
ctx.Done() == ctx.Background().Done() is just a long way to write ctx.Done() == nil. Use the short way. Change-Id: I7b3198b5dc46b8b40086243aa61882bc8c268eac Reviewed-on: https://go-review.googlesource.com/78128 Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 442d15a commit b9dca1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/database/sql/ctxutil.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func ctxDriverBegin(ctx context.Context, opts *TxOptions, ci driver.Conn) (drive
120120
}
121121
}
122122

123-
if ctx.Done() == context.Background().Done() {
123+
if ctx.Done() == nil {
124124
return ci.Begin()
125125
}
126126

0 commit comments

Comments
 (0)