google / wire

Compile-time Dependency Injection for Go
Apache License 2.0
13.14k stars 625 forks source link

go build -mod=vendor ./cmd/wire doesn't work after update to 0.6.0 #404

Open dsh2dsh opened 9 months ago

dsh2dsh commented 9 months ago

You can use go bug to have a cool, automatically filled out bug template, or fill out the template below.

Describe the bug

go build -mod=vendor ./cmd/wire doesn't work after update to 0.6.0

To Reproduce

go mod vendor
go build -mod=vendor ./cmd/wire

# golang.org/x/tools/internal/event/keys
vendor/golang.org/x/tools/internal/event/keys/util.go:14:11: type parameter requires go1.18 or later (-lang was set to go1.16; check go.mod)
vendor/golang.org/x/tools/internal/event/keys/util.go:14:13: embedding interface element ~[]T requires go1.18 or later (-lang was set to go1.16; check go.mod)
vendor/golang.org/x/tools/internal/event/keys/util.go:14:21: embedding interface element ~string requires go1.18 or later (-lang was set to go1.16; check go.mod)
vendor/golang.org/x/tools/internal/event/keys/util.go:15:32: invalid argument: s (variable of type S constrained by ~[]T) for len
vendor/golang.org/x/tools/internal/event/keys/util.go:16:20: cannot range over s (variable of type S constrained by ~[]T): no core type
# golang.org/x/tools/internal/versions
vendor/golang.org/x/tools/internal/versions/types.go:15:16: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)

Expected behavior

I'm expecting successful build.

Version

0.6.0

Additional context

The fix would be bump go version in go.mod from 1.12 to 1.18.

saviorand commented 1 day ago

@vangent @zombiezen @shantuo wanted to make sure this is visible. We have this problem as well