mirror of https://github.com/golang/go.git
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 <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
442d15abc3
commit
b9dca1b165
|
|
@ -120,7 +120,7 @@ func ctxDriverBegin(ctx context.Context, opts *TxOptions, ci driver.Conn) (drive
|
|||
}
|
||||
}
|
||||
|
||||
if ctx.Done() == context.Background().Done() {
|
||||
if ctx.Done() == nil {
|
||||
return ci.Begin()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue