aboutsummaryrefslogtreecommitdiff
path: root/src/errors/wrap_test.go
diff options
context:
space:
mode:
authorAhsun Ahmed <ahmed.ahsun@gmail.com>2019-03-21 22:45:49 +0600
committerMarcel van Lohuizen <mpvl@golang.org>2019-04-10 15:59:35 +0000
commitfda5e6d6fa7abfe974a58dfeeceb95a8165d1b63 (patch)
tree9f9e293052703b687e7c38fbf16454fba1aca51b /src/errors/wrap_test.go
parent607493bed678cbf3a456e9de8e7e74622ec83da8 (diff)
downloadgo-fda5e6d6fa7abfe974a58dfeeceb95a8165d1b63.tar.xz
errors: return false if nil error is passed to As
Fixes #30970 Change-Id: I333676b55a2364e329fffeafca8fc57d45a0b84b Reviewed-on: https://go-review.googlesource.com/c/go/+/168598 Reviewed-by: Marcel van Lohuizen <mpvl@golang.org> Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/errors/wrap_test.go')
-rw-r--r--src/errors/wrap_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/errors/wrap_test.go b/src/errors/wrap_test.go
index 657890c1a6..022f429c0c 100644
--- a/src/errors/wrap_test.go
+++ b/src/errors/wrap_test.go
@@ -90,6 +90,10 @@ func TestAs(t *testing.T) {
target interface{}
match bool
}{{
+ nil,
+ &errP,
+ false,
+ }, {
wrapped{"pittied the fool", errorT{}},
&errT,
true,