-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/analysis/passes/errorsas: warn if errors.As target is *error
Passing an *error as the second parameter to errors.As always matches, making this test: var e error if errors.As(err, &e) { ... } equivalent to: e := err if err != nil { ... } Warn when the second parameter to errors.As has type *error. Fixes golang/go#47528. Change-Id: Ia0e25003493f3b349ab500f0b4d08c2acf88b328 Reviewed-on: https://go-review.googlesource.com/c/tools/+/339889 Reviewed-by: Tim King <taking@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
- Loading branch information
Showing
2 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters