1 env GO111MODULE=on
2
3 # TODO(golang.org/issue/41297): we shouldn't need go.sum. None of the commands
4 # below depend on the build list.
5
6 go list -m -versions rsc.io/quote
7 stdout '^rsc.io/quote 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$'
8
9 # Latest rsc.io/quote should be v1.5.2, not v1.5.3-pre1.
10 go list -m rsc.io/quote@latest
11 stdout 'rsc.io/quote v1.5.2$'
12
13 # Same for rsc.io/quote@v1 and rsc.io/quote@v1.5 (with no patch version).
14 go list -m rsc.io/quote@v1
15 stdout 'rsc.io/quote v1.5.2$'
16 go list -m rsc.io/quote@v1.5
17 stdout 'rsc.io/quote v1.5.2$'
18
19 # We should fall back to prereleases if no release tags match...
20 go list -m rsc.io/quote@>v1.5.2
21 stdout 'rsc.io/quote v1.5.3-pre1$'
22
23 # ...but prefer release versions when given the option.
24 go list -m rsc.io/quote@<v1.5.4
25 stdout 'rsc.io/quote v1.5.2$'
26
27 ! go list -m rsc.io/quote@>v1.5.3
28 stderr 'go: module rsc.io/quote: no matching versions for query ">v1.5.3"'
29
30 go list -m -e -f '{{.Error.Err}}' rsc.io/quote@>v1.5.3
31 stdout 'no matching versions for query ">v1.5.3"'
32
33 -- go.mod --
34 module x
35 require rsc.io/quote v1.0.0
36
37 -- go.sum --
38 rsc.io/quote v1.0.0 h1:kQ3IZQzPTiDJxSZI98YaWgxFEhlNdYASHvh+MplbViw=
39 rsc.io/quote v1.0.0/go.mod h1:v83Ri/njykPcgJltBc/gEkJTmjTsNgtO1Y7vyIK1CQA=
40 -- use.go --
41 package use
42
43 import _ "rsc.io/quote"
44
View as plain text