blob: 5b768faeb1802c7ffca5389a0eb74d34aa7418db [file] [log] [blame]
cp go.mod go.mod.orig
# getting a specific version of a module along with a pattern
# not yet present in that module should report the version mismatch
# rather than a "matched no packages" warning.
! go get -d
stderr '^go get: conflicts with \(v1.2.0\)$'
! stderr 'matched no packages'
cmp go.mod.orig go.mod
# A wildcard pattern should match the pattern with that path.
go get -d
go list -m all
stdout '^ v1.0.0'
cp go.mod.orig go.mod
# If we need to resolve a transitive dependency of a package,
# and another argument constrains away the version that provides that
# package, then 'go get' should fail with a useful error message.
! go get -d .
stderr '^ imports\n\ cannot find module providing package$'
! stderr ' v1\.2\.0'
cmp go.mod.orig go.mod
go get -d
! go list -deps -mod=readonly .
stderr '^m.go:3:8: cannot find module providing package example\.net/pkgadded/subpkg: '
-- go.mod --
go 1.16
require v1.2.0
-- m.go --
package m
import _ ""