aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vendor
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-12-07 17:09:41 -0500
committerRuss Cox <rsc@golang.org>2021-12-08 15:15:40 +0000
commit08025a9d6d7d33f3ac0c78b4d067bdc339225507 (patch)
treedef84cd095afa9bec9b3ad82c75e57b228c90879 /src/cmd/vendor
parenta19e72cb89fd33e5bf1474887e267806f65b7a40 (diff)
downloadgo-08025a9d6d7d33f3ac0c78b4d067bdc339225507.tar.gz
go-08025a9d6d7d33f3ac0c78b4d067bdc339225507.zip
cmd: go get golang.org/x/tools@fd2bfb7 (Dec 7 2021)
cd src/cmd go get golang.org/x/tools@fd2bfb7 go mod tidy go mod vendor Brings in fixes to cmd/vet for 'any' changes. Change-Id: I70a48d451bd99f5d82f91fd079fbdd1b4bac2520 Reviewed-on: https://go-review.googlesource.com/c/go/+/370136 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/vendor')
-rw-r--r--src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go6
-rw-r--r--src/cmd/vendor/modules.txt2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go
index 64a28ac0b9..cc9497179d 100644
--- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go
+++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go
@@ -61,7 +61,7 @@ var Analyzer = &analysis.Analyzer{
// we let it go. But if it does have a fmt.ScanState, then the
// rest has to match.
var canonicalMethods = map[string]struct{ args, results []string }{
- "As": {[]string{"interface{}"}, []string{"bool"}}, // errors.As
+ "As": {[]string{"any"}, []string{"bool"}}, // errors.As
// "Flush": {{}, {"error"}}, // http.Flusher and jpeg.writer conflict
"Format": {[]string{"=fmt.State", "rune"}, []string{}}, // fmt.Formatter
"GobDecode": {[]string{"[]byte"}, []string{"error"}}, // gob.GobDecoder
@@ -194,7 +194,9 @@ func matchParams(pass *analysis.Pass, expect []string, actual *types.Tuple, pref
func matchParamType(expect string, actual types.Type) bool {
expect = strings.TrimPrefix(expect, "=")
// Overkill but easy.
- return typeString(actual) == expect
+ t := typeString(actual)
+ return t == expect ||
+ (t == "any" || t == "interface{}") && (expect == "any" || expect == "interface{}")
}
var errorType = types.Universe.Lookup("error").Type().Underlying().(*types.Interface)
diff --git a/src/cmd/vendor/modules.txt b/src/cmd/vendor/modules.txt
index 5ce2fe2f63..22dd145a55 100644
--- a/src/cmd/vendor/modules.txt
+++ b/src/cmd/vendor/modules.txt
@@ -51,7 +51,7 @@ golang.org/x/sys/windows
# golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
## explicit; go 1.17
golang.org/x/term
-# golang.org/x/tools v0.1.8-0.20211202032535-e212aff8fd14
+# golang.org/x/tools v0.1.9-0.20211207220608-fd2bfb79a16a
## explicit; go 1.17
golang.org/x/tools/cover
golang.org/x/tools/go/analysis