aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql
diff options
context:
space:
mode:
authorKyle Nusbaum <kyle@datadog.com>2020-03-18 19:17:50 +0000
committerIan Lance Taylor <iant@golang.org>2020-03-18 19:44:13 +0000
commit02057906f7272a4787b8a0b5b7cafff8ad3024f0 (patch)
treecd3c8ba378df1c1f1c3c7b2a51ac42f721067178 /src/database/sql
parent61ce82a3601955a39ef26f51654fa2abc2049c11 (diff)
downloadgo-02057906f7272a4787b8a0b5b7cafff8ad3024f0.tar.xz
context: prevent creation of invalid contexts
This commit makes it impossible to create derived contexts with nil parents. Previously it was possible to create derived contexts with nil parents, and invalid contexts could propogate through the program. Eventually this can cause a panic downstream, which is difficult to trace back to the source of the error. Although `WithCancel` and `WithDeadline` already panic if `parent` is `nil`, this adds explicit checks to give a useful message in the panic. Fixes #37908 Change-Id: I70fd01f6539c1b0da0e775fc5457e32e7075e52c GitHub-Last-Rev: 1b7dadd7db9ba42952644ad5e9a49591d6a5191f GitHub-Pull-Request: golang/go#37898 Reviewed-on: https://go-review.googlesource.com/c/go/+/223777 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/database/sql')
0 files changed, 0 insertions, 0 deletions