aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-toolsmith
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2022-09-05 14:27:54 +0200
committerGitHub <noreply@github.com>2022-09-05 12:27:54 +0000
commitb2f2446b46bf02821d90ebedadae2bf7ae0e880e (patch)
tree923cf42842918d6bebca1d6bbdc08abed54d274d /vendor/github.com/go-toolsmith
parente6654faff4bcca4be92e9a8596fd4b77f747c39e (diff)
go.mod, vendor: update (#3358)
* go.mod, vendor: remove unnecessary dependencies Commands: 1. go mod tidy 2. go mod vendor * go.mod, vendor: update cloud.google.com/go Commands: 1. go get -u cloud.google.com/go 2. go mod tidy 3. go mod vendor * go.mod, vendor: update cloud.google.com/* Commands: 1. go get -u cloud.google.com/storage cloud.google.com/logging 2. go mod tidy 3. go mod vendor * go.mod, .golangci.yml, vendor: update *lint* Commands: 1. go get -u golang.org/x/tools github.com/golangci/golangci-lint@v1.47.0 2. go mod tidy 3. go mod vendor 4. edit .golangci.yml to suppress new errors (resolved in the same PR later) * all: fix lint errors hash.go: copy() recommended by gosimple parse.go: ent is never nil verifier.go: signal.Notify() with unbuffered channel is bad. Have no idea why. * .golangci.yml: adjust godot rules check-all is deprecated, but still work if you're hesitating too - I'll remove this commit
Diffstat (limited to 'vendor/github.com/go-toolsmith')
-rw-r--r--vendor/github.com/go-toolsmith/astcopy/astcopy.go8
-rw-r--r--vendor/github.com/go-toolsmith/astcopy/go.mod5
-rw-r--r--vendor/github.com/go-toolsmith/astcopy/go.sum6
-rw-r--r--vendor/github.com/go-toolsmith/astequal/astequal.go16
-rw-r--r--vendor/github.com/go-toolsmith/astequal/go.mod6
-rw-r--r--vendor/github.com/go-toolsmith/astequal/go.sum4
6 files changed, 40 insertions, 5 deletions
diff --git a/vendor/github.com/go-toolsmith/astcopy/astcopy.go b/vendor/github.com/go-toolsmith/astcopy/astcopy.go
index 2feffb199..393c5cabc 100644
--- a/vendor/github.com/go-toolsmith/astcopy/astcopy.go
+++ b/vendor/github.com/go-toolsmith/astcopy/astcopy.go
@@ -3,6 +3,8 @@ package astcopy
import (
"go/ast"
+
+ "golang.org/x/exp/typeparams"
)
// Node returns x node deep copy.
@@ -341,6 +343,9 @@ func FuncType(x *ast.FuncType) *ast.FuncType {
cp := *x
cp.Params = FieldList(x.Params)
cp.Results = FieldList(x.Results)
+ if typeParams := typeparams.ForFuncType(x); typeParams != nil {
+ *typeparams.ForFuncType(&cp) = *FieldList(typeParams)
+ }
return &cp
}
@@ -429,6 +434,9 @@ func TypeSpec(x *ast.TypeSpec) *ast.TypeSpec {
cp.Type = copyExpr(x.Type)
cp.Doc = CommentGroup(x.Doc)
cp.Comment = CommentGroup(x.Comment)
+ if typeParams := typeparams.ForTypeSpec(x); typeParams != nil {
+ *typeparams.ForTypeSpec(&cp) = *FieldList(typeParams)
+ }
return &cp
}
diff --git a/vendor/github.com/go-toolsmith/astcopy/go.mod b/vendor/github.com/go-toolsmith/astcopy/go.mod
index 6f3b3027a..8e34ca50f 100644
--- a/vendor/github.com/go-toolsmith/astcopy/go.mod
+++ b/vendor/github.com/go-toolsmith/astcopy/go.mod
@@ -1,6 +1,9 @@
module github.com/go-toolsmith/astcopy
+go 1.16
+
require (
- github.com/go-toolsmith/astequal v1.0.0
+ github.com/go-toolsmith/astequal v1.0.2
github.com/go-toolsmith/strparse v1.0.0
+ golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171
)
diff --git a/vendor/github.com/go-toolsmith/astcopy/go.sum b/vendor/github.com/go-toolsmith/astcopy/go.sum
index aa0857030..743006ed1 100644
--- a/vendor/github.com/go-toolsmith/astcopy/go.sum
+++ b/vendor/github.com/go-toolsmith/astcopy/go.sum
@@ -1,4 +1,6 @@
-github.com/go-toolsmith/astequal v1.0.0 h1:4zxD8j3JRFNyLN46lodQuqz3xdKSrur7U/sr0SDS/gQ=
-github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY=
+github.com/go-toolsmith/astequal v1.0.2 h1:+XvaV8zNxua+9+Oa4AHmgmpo4RYAbwr/qjNppLfX2yM=
+github.com/go-toolsmith/astequal v1.0.2/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4=
github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4=
github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
+golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171 h1:DZhP7zSquENyG3Yb6ZpGqNEtgE8dfXhcLcheIF9RQHY=
+golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
diff --git a/vendor/github.com/go-toolsmith/astequal/astequal.go b/vendor/github.com/go-toolsmith/astequal/astequal.go
index 6a32d7218..b2ab0e640 100644
--- a/vendor/github.com/go-toolsmith/astequal/astequal.go
+++ b/vendor/github.com/go-toolsmith/astequal/astequal.go
@@ -4,6 +4,8 @@ package astequal
import (
"go/ast"
"go/token"
+
+ "golang.org/x/exp/typeparams"
)
// Node reports whether two AST nodes are structurally (deep) equal.
@@ -60,6 +62,14 @@ func astNodeEq(x, y ast.Node) bool {
case ast.Decl:
y, ok := y.(ast.Decl)
return ok && astDeclEq(x, y)
+
+ case *ast.Field:
+ y, ok := y.(*ast.Field)
+ return ok && astFieldEq(x, y)
+ case *ast.FieldList:
+ y, ok := y.(*ast.FieldList)
+ return ok && astFieldListEq(x, y)
+
default:
return false
}
@@ -308,7 +318,8 @@ func astFuncTypeEq(x, y *ast.FuncType) bool {
return x == y
}
return astFieldListEq(x.Params, y.Params) &&
- astFieldListEq(x.Results, y.Results)
+ astFieldListEq(x.Results, y.Results) &&
+ astFieldListEq(typeparams.ForFuncType(x), typeparams.ForFuncType(y))
}
func astBasicLitEq(x, y *ast.BasicLit) bool {
@@ -667,7 +678,8 @@ func astTypeSpecEq(x, y *ast.TypeSpec) bool {
if x == nil || y == nil {
return x == y
}
- return astIdentEq(x.Name, y.Name) && astExprEq(x.Type, y.Type)
+ return astIdentEq(x.Name, y.Name) && astExprEq(x.Type, y.Type) &&
+ astFieldListEq(typeparams.ForTypeSpec(x), typeparams.ForTypeSpec(y))
}
func astValueSpecEq(x, y *ast.ValueSpec) bool {
diff --git a/vendor/github.com/go-toolsmith/astequal/go.mod b/vendor/github.com/go-toolsmith/astequal/go.mod
index 86fa40772..f5a12599c 100644
--- a/vendor/github.com/go-toolsmith/astequal/go.mod
+++ b/vendor/github.com/go-toolsmith/astequal/go.mod
@@ -1 +1,7 @@
module github.com/go-toolsmith/astequal
+
+go 1.16
+
+require github.com/go-toolsmith/strparse v1.0.0
+
+require golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171 // indirect
diff --git a/vendor/github.com/go-toolsmith/astequal/go.sum b/vendor/github.com/go-toolsmith/astequal/go.sum
new file mode 100644
index 000000000..74e570ff4
--- /dev/null
+++ b/vendor/github.com/go-toolsmith/astequal/go.sum
@@ -0,0 +1,4 @@
+github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4=
+github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8=
+golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171 h1:DZhP7zSquENyG3Yb6ZpGqNEtgE8dfXhcLcheIF9RQHY=
+golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=