From fda5e6d6fa7abfe974a58dfeeceb95a8165d1b63 Mon Sep 17 00:00:00 2001 From: Ahsun Ahmed Date: Thu, 21 Mar 2019 22:45:49 +0600 Subject: 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 Run-TryBot: Marcel van Lohuizen TryBot-Result: Gobot Gobot --- src/errors/wrap_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/errors/wrap_test.go') 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, -- cgit v1.3