blob: e10185709d95a6083121d9dda6efee196d44aa78 [file] [log] [blame]
env GO111MODULE=on
# Populate go.sum.
# TODO( we shouldn't need go.sum. None of the commands
# below depend on the build list.
go mod download
go list -m -versions
stdout '^ v1.0.0 v1.1.0 v1.2.0 v1.2.1 v1.3.0 v1.4.0 v1.5.0 v1.5.1 v1.5.2 v1.5.3-pre1$'
# Latest should be v1.5.2, not v1.5.3-pre1.
go list -m
stdout ' v1.5.2$'
# Same for and (with no patch version).
go list -m
stdout ' v1.5.2$'
go list -m
stdout ' v1.5.2$'
# We should fall back to prereleases if no release tags match...
go list -m>v1.5.2
stdout ' v1.5.3-pre1$'
# ...but prefer release versions when given the option.
go list -m<v1.5.4
stdout ' v1.5.2$'
! go list -m>v1.5.3
stderr 'go list -m: module no matching versions for query ">v1.5.3"'
go list -m -e -f '{{.Error.Err}}'>v1.5.3
stdout 'no matching versions for query ">v1.5.3"'
-- go.mod --
module x
require v1.0.0
-- use.go --
package use
import _ ""