Skip to content

Commit

Permalink
go/analysis/passes/deepequalerrors: audit for types.Alias safety
Browse files Browse the repository at this point in the history
Updates golang/go#65294

Change-Id: I00543b00c830ff5a4fe442f1bcf6f21ab0b12d97
Reviewed-on: https://go-review.googlesource.com/c/tools/+/559916
Reviewed-by: Tim King <taking@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
adonovan authored and gopherbot committed Feb 8, 2024
1 parent f4fa7a7 commit 314368d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/analysis/passes/deepequalerrors/deepequalerrors.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
"golang.org/x/tools/go/ast/inspector"
"golang.org/x/tools/go/types/typeutil"
"golang.org/x/tools/internal/aliases"
)

const Doc = `check for calls of reflect.DeepEqual on error values
Expand Down Expand Up @@ -101,7 +102,8 @@ func containsError(typ types.Type) bool {
return true
}
}
case *types.Named:
case *types.Named,
*aliases.Alias:
return check(t.Underlying())

// We list the remaining valid type kinds for completeness.
Expand Down

0 comments on commit 314368d

Please sign in to comment.