We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go mod download of a specific version of a module should download only that module.
go mod download
Today, if that version happens to have a replacement, go mod download also downloads the go.mod file (but not the .zip file) for its replacement.
go.mod
.zip
$ go mod init golang.org/issue/scratch go: creating new go.mod: module golang.org/issue/scratch $ go mod edit -require golang.org/x/[email protected] $ go mod edit -replace golang.org/x/[email protected]=golang.org/x/[email protected] $ go mod download -json golang.org/x/[email protected] go: finding golang.org/x/text v0.3.0 go: finding golang.org/x/text v0.2.0 { "Path": "golang.org/x/text", "Version": "v0.2.0", "Info": "/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.info", "GoMod": "/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.mod", "Zip": "/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.zip", "Dir": "/tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/golang.org/x/[email protected]", "Sum": "h1:WtDSLEtcB5GqbjSlyn8XcYtxjw+SgFMc2RILOvq7CuE=", "GoModSum": "h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=" } $ find $GOPATH -name '*.mod' /tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.mod /tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.3.0.mod $ find $GOPATH -name '*.zip' /tmp/tmp.3uwW75Tyk7/_gopath/pkg/mod/cache/download/golang.org/x/text/@v/v0.2.0.zip
The text was updated successfully, but these errors were encountered:
(Found while investigating #27868.)
Sorry, something went wrong.
I fixed this problem in my local repo, but from the test script:
go mod download will not follow replacements for explicit module queries.
Maybe we need to think about it again.
No branches or pull requests
go mod download
of a specific version of a module should download only that module.Today, if that version happens to have a replacement,
go mod download
also downloads thego.mod
file (but not the.zip
file) for its replacement.The text was updated successfully, but these errors were encountered: