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
Unable to get package. github.com/zricethezav/gitleaks/v7 requires minimum version [go1.16]. You are running [go1.15.15].
What did you see instead?
...
pkg/mod/github.com/zricethezav/gitleaks/v7@v7.6.1/config/config.go:4:2: package embed is not in GOROOT (/Users/andrew/sdk/go1.15.15/src/embed)
The error message is somewhat misleading. The command actually fails because embed did not exist before go1.16.
Instead, it seems to me the commands should fail immediately because the go version does not satisfy the minimum version specified in the package's go.mod file. It would be great to see something like this:
Unable to get package. github.com/zricethezav/gitleaks/v7 requires minimum version [go1.16]. You are running [go1.15.15].
The text was updated successfully, but these errors were encountered:
seankhliao
changed the title
go get does not enforce minimum version from package's go.mod file
cmd/go: get does not enforce minimum version from package's go.mod file
Sep 23, 2021
A module needs to declare the higher version to be able to make use of the new features, however, it can still choose to support older versions through the use of build tags.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
N/A
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
The target package (github.com/zricethezav/gitleaks/v7) has a go.mod file that specifies minimum version
go 1.16
. (https://github.com/zricethezav/gitleaks/blob/master/go.mod)Therefore, I expect to see a meaningful error like this:
What did you see instead?
The error message is somewhat misleading. The command actually fails because
embed
did not exist beforego1.16
.Instead, it seems to me the commands should fail immediately because the go version does not satisfy the minimum version specified in the package's go.mod file. It would be great to see something like this:
The text was updated successfully, but these errors were encountered: