You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd /tmp && git clone https://gist.github.com/c4d5092d60ba6f8328cdf93a48d9c89a.git && cd c4d5092d60ba6f8328cdf93a48d9c89a
go install -p 1 github.com/golangci/golangci-lint/cmd/golangci-lint
What did you expect to see?
No error. Binary gets built and installed into GOBIN. The version used is taken from the go.mod file.
What did you see instead?
# golang.org/x/sys/unix
/home/martin/go/pkg/mod/golang.org/x/sys@v0.1.0/unix/syscall.go:83:16: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
/home/martin/go/pkg/mod/golang.org/x/sys@v0.1.0/unix/syscall_linux.go:2255:9: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
/home/martin/go/pkg/mod/golang.org/x/sys@v0.1.0/unix/syscall_unix.go:118:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
/home/martin/go/pkg/mod/golang.org/x/sys@v0.1.0/unix/sysvshm_unix.go:33:7: unsafe.Slice requires go1.17 or later (-lang was set to go1.16; check go.mod)
# golang.org/x/exp/constraints
/home/martin/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:13:2: embedding interface element ~int | ~int8 | ~int16 | ~int32 | ~int64 requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/martin/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:20:2: embedding interface element ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/martin/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:27:2: embedding interface element Signed | Unsigned requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/martin/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:34:2: embedding interface element ~float32 | ~float64 requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/martin/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:41:2: embedding interface element ~complex64 | ~complex128 requires go1.18 or later (-lang was set to go1.16; check go.mod)
/home/martin/go/pkg/mod/golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e/constraints/constraints.go:49:2: embedding interface element Integer | Float | ~string requires go1.18 or later (-lang was set to go1.16; check go.mod)
# github.com/golangci/gofmt/gofmt
/home/martin/go/pkg/mod/github.com/golangci/gofmt@v0.0.0-20220901101216-f2edd75033f2/gofmt/gofmt.go:195:49: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)
Note that when using -mod=mod flag, there is no error and the go.mod and go.sum files are not modified.
If I specify the version after the package name in the go install command (go install -mod=mod -p 1 github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1), there is no error either. However, I'd like to have the sums of the dependencies committed in my repository in case some of the tags are updated.
I don't know if this is somehow related to #54908 or not.
The text was updated successfully, but these errors were encountered:
Same error happens when running go build -o=/tmp/golangci-lint-v1.51.0 github.com/golangci/golangci-lint/cmd/golangci-lint from the directory with the go.mod and go.sum files.
I believe this is working as intended, the go.mod/go.sum file is incomplete for the required build of github.com/golangci/golangci-lint/cmd/golangci-lint, as shown when you add a blank import and run go mod tidy.
Thank you, that at least hints at how I can fix the build.
The error message says that /home/martin/go/pkg/mod/golang.org/x/sys@v0.1.0 uses Go 1.16, while it has Go 1.17 clearly specified in its go.mod file. The error message is misleading. It is not clear from the error message what I need to change to fix the issue. Perhaps the error message should be something like module %s missing from go.mod/go.sum, run go mod tidy instead of the current cryptic message?
What version of Go are you using (
go version
)?Also:
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
cd /tmp && git clone https://gist.github.com/c4d5092d60ba6f8328cdf93a48d9c89a.git && cd c4d5092d60ba6f8328cdf93a48d9c89a
go install -p 1 github.com/golangci/golangci-lint/cmd/golangci-lint
What did you expect to see?
No error. Binary gets built and installed into GOBIN. The version used is taken from the go.mod file.
What did you see instead?
-mod=mod
flag, there is no error and the go.mod and go.sum files are not modified.go install -mod=mod -p 1 github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
), there is no error either. However, I'd like to have the sums of the dependencies committed in my repository in case some of the tags are updated.I don't know if this is somehow related to #54908 or not.
The text was updated successfully, but these errors were encountered: