File: //opt/golang/1.22.0/src/cmd/go/testdata/script/mod_get_moved.txt
env GO111MODULE=on
[short] skip
# A 'go get' that worked at a previous version should continue to work at that version,
# even if the package was subsequently moved into a submodule.
go mod init example.com/foo
go get example.com/split/[email protected]
go list -m all
stdout 'example.com/split v1.0.0'
# A 'go get' that simultaneously upgrades away conflicting package definitions is not ambiguous.
go get example.com/split/[email protected]
# A 'go get' without an upgrade should find the package.
rm go.mod
go mod init example.com/foo
go get example.com/split/subpkg
go list -m all
stdout 'example.com/split/subpkg v1.1.0'
# A 'go get' that worked at a previous version should continue to work at that version,
# even if the package was subsequently moved into a parent module.
rm go.mod
go mod init example.com/foo
go get example.com/join/[email protected]
go list -m all
stdout 'example.com/join/subpkg v1.0.0'
# A 'go get' that simultaneously upgrades away conflicting package definitions is not ambiguous.
# (A wildcard pattern applies to both packages and modules,
# because we define wildcard matching to apply after version resolution.)
go get example.com/join/subpkg/[email protected]
# A 'go get' without an upgrade should find the package.
rm go.mod
go mod init example.com/foo
go get example.com/join/[email protected]
go list -m all
stdout 'example.com/join v1.1.0'