Skip to content

Commit

Permalink
go/analysis/passes/errorsas: update testdata for new warning
Browse files Browse the repository at this point in the history
A new testdata file was added since CL 339889 was authored.
Update it in the same way for the new warning.

Updates golang/go#47528.
Fixes golang/go#52613.

Change-Id: I17d06c602eeabcc4ddc8514d5e444acdb714ab94
Reviewed-on: https://go-review.googlesource.com/c/tools/+/403034
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Tim King <taking@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
  • Loading branch information
dmitshur authored and gopherbot committed Apr 29, 2022
1 parent 115b454 commit 6fff1af
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -28,7 +28,7 @@ func _[E error](e E) {
errors.As(nil, &e)
errors.As(nil, &m) // *T where T implemements error
errors.As(nil, &tw.t) // *T where T implements error
errors.As(nil, perr[error]()) // *error, via a call
errors.As(nil, perr[error]()) // want `second argument to errors.As should not be \*error`

errors.As(nil, e) // want `second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type`
errors.As(nil, m) // want `second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type`
Expand Down

0 comments on commit 6fff1af

Please sign in to comment.