mirror of
https://github.com/golang/go.git
synced 2025-11-11 06:01:06 +00:00
cmd: update to latest golang.org/x/tools
In particular bring in CL 201973, which reverts support for multiple keys in a struct tag. For #40281 For #43083 For #43226 Change-Id: I66e76639cbbca55bdbff6956acdb0a97650fdd31 Reviewed-on: https://go-review.googlesource.com/c/go/+/282412 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
parent
9ec21a8f34
commit
54bd1ccce2
14 changed files with 84 additions and 62 deletions
|
|
@ -8,5 +8,5 @@ require (
|
||||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
|
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
|
||||||
golang.org/x/mod v0.4.0
|
golang.org/x/mod v0.4.0
|
||||||
golang.org/x/sys v0.0.0-20201204225414-ed752295db88 // indirect
|
golang.org/x/sys v0.0.0-20201204225414-ed752295db88 // indirect
|
||||||
golang.org/x/tools v0.0.0-20201211025543-abf6a1d87e11
|
golang.org/x/tools v0.0.0-20210107193943-4ed967dd8eff
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20201211025543-abf6a1d87e11 h1:9j/upNXDRpADUw2RpUfJ7E7GHtfhDih62kX6JM8vs2c=
|
golang.org/x/tools v0.0.0-20210107193943-4ed967dd8eff h1:6EkB024TP1fu6cmQqeCNw685zYDVt5g8N1BXh755SQM=
|
||||||
golang.org/x/tools v0.0.0-20201211025543-abf6a1d87e11/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210107193943-4ed967dd8eff/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package analysis
|
package analysis
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/analysis/diagnostic.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/analysis/diagnostic.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2019 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package analysis
|
package analysis
|
||||||
|
|
||||||
import "go/token"
|
import "go/token"
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Package analysis defines the interface between a modular static
|
Package analysis defines the interface between a modular static
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package analysisflags
|
package analysisflags
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil/util.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil/util.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// Package analysisutil defines various helper functions
|
// Package analysisutil defines various helper functions
|
||||||
// used by two or more packages beneath go/analysis.
|
// used by two or more packages beneath go/analysis.
|
||||||
package analysisutil
|
package analysisutil
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package printf
|
package printf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
32
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go
generated
vendored
32
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go
generated
vendored
|
|
@ -207,12 +207,12 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
// validateStructTag parses the struct tag and returns an error if it is not
|
// validateStructTag parses the struct tag and returns an error if it is not
|
||||||
// in the canonical format, as defined by reflect.StructTag.
|
// in the canonical format, which is a space-separated list of key:"value"
|
||||||
|
// settings. The value may contain spaces.
|
||||||
func validateStructTag(tag string) error {
|
func validateStructTag(tag string) error {
|
||||||
// This code is based on the StructTag.Get code in package reflect.
|
// This code is based on the StructTag.Get code in package reflect.
|
||||||
|
|
||||||
n := 0
|
n := 0
|
||||||
var keys []string
|
|
||||||
for ; tag != ""; n++ {
|
for ; tag != ""; n++ {
|
||||||
if n > 0 && tag != "" && tag[0] != ' ' {
|
if n > 0 && tag != "" && tag[0] != ' ' {
|
||||||
// More restrictive than reflect, but catches likely mistakes
|
// More restrictive than reflect, but catches likely mistakes
|
||||||
|
|
@ -240,27 +240,14 @@ func validateStructTag(tag string) error {
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
return errTagKeySyntax
|
return errTagKeySyntax
|
||||||
}
|
}
|
||||||
if i+1 >= len(tag) || tag[i] < ' ' || tag[i] == 0x7f {
|
if i+1 >= len(tag) || tag[i] != ':' {
|
||||||
return errTagSyntax
|
return errTagSyntax
|
||||||
}
|
}
|
||||||
key := tag[:i]
|
if tag[i+1] != '"' {
|
||||||
keys = append(keys, key)
|
|
||||||
tag = tag[i:]
|
|
||||||
|
|
||||||
// If we found a space char here - assume that we have a tag with
|
|
||||||
// multiple keys.
|
|
||||||
if tag[0] == ' ' {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// Spaces were filtered above so we assume that here we have
|
|
||||||
// only valid tag value started with `:"`.
|
|
||||||
if tag[0] != ':' || tag[1] != '"' {
|
|
||||||
return errTagValueSyntax
|
return errTagValueSyntax
|
||||||
}
|
}
|
||||||
|
key := tag[:i]
|
||||||
// Remove the colon leaving tag at the start of the quoted string.
|
tag = tag[i+1:]
|
||||||
tag = tag[1:]
|
|
||||||
|
|
||||||
// Scan quoted string to find value.
|
// Scan quoted string to find value.
|
||||||
i = 1
|
i = 1
|
||||||
|
|
@ -276,17 +263,15 @@ func validateStructTag(tag string) error {
|
||||||
qvalue := tag[:i+1]
|
qvalue := tag[:i+1]
|
||||||
tag = tag[i+1:]
|
tag = tag[i+1:]
|
||||||
|
|
||||||
wholeValue, err := strconv.Unquote(qvalue)
|
value, err := strconv.Unquote(qvalue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errTagValueSyntax
|
return errTagValueSyntax
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, key := range keys {
|
|
||||||
if !checkTagSpaces[key] {
|
if !checkTagSpaces[key] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
value := wholeValue
|
|
||||||
switch key {
|
switch key {
|
||||||
case "xml":
|
case "xml":
|
||||||
// If the first or last character in the XML tag is a space, it is
|
// If the first or last character in the XML tag is a space, it is
|
||||||
|
|
@ -324,8 +309,5 @@ func validateStructTag(tag string) error {
|
||||||
return errTagValueSpace
|
return errTagValueSpace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
keys = keys[:0]
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker112.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker112.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// +build go1.12
|
// +build go1.12
|
||||||
|
|
||||||
package unitchecker
|
package unitchecker
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package analysis
|
package analysis
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/util.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/util.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2015 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package astutil
|
package astutil
|
||||||
|
|
||||||
import "go/ast"
|
import "go/ast"
|
||||||
|
|
|
||||||
4
src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go
generated
vendored
4
src/cmd/vendor/golang.org/x/tools/go/ast/inspector/typeof.go
generated
vendored
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package inspector
|
package inspector
|
||||||
|
|
||||||
// This file defines func typeOf(ast.Node) uint64.
|
// This file defines func typeOf(ast.Node) uint64.
|
||||||
|
|
|
||||||
2
src/cmd/vendor/modules.txt
vendored
2
src/cmd/vendor/modules.txt
vendored
|
|
@ -44,7 +44,7 @@ golang.org/x/mod/zip
|
||||||
golang.org/x/sys/internal/unsafeheader
|
golang.org/x/sys/internal/unsafeheader
|
||||||
golang.org/x/sys/unix
|
golang.org/x/sys/unix
|
||||||
golang.org/x/sys/windows
|
golang.org/x/sys/windows
|
||||||
# golang.org/x/tools v0.0.0-20201211025543-abf6a1d87e11
|
# golang.org/x/tools v0.0.0-20210107193943-4ed967dd8eff
|
||||||
## explicit
|
## explicit
|
||||||
golang.org/x/tools/go/analysis
|
golang.org/x/tools/go/analysis
|
||||||
golang.org/x/tools/go/analysis/internal/analysisflags
|
golang.org/x/tools/go/analysis/internal/analysisflags
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue