deoren / notes

Various notes for topics I'm learning
2 stars 0 forks source link

Go | List available versions of a package #99

Open deoren opened 4 years ago

deoren commented 4 years ago
$ go list -mod=mod -m -versions gopkg.in/yaml.v2
gopkg.in/yaml.v2 v2.0.0 v2.1.0 v2.1.1 v2.2.0 v2.2.1 v2.2.2 v2.2.3 v2.2.4 v2.2.5 v2.2.6 v2.2.7 v2.2.8 v2.3.0

The -mod=mod was needed because I had a local vendor directory maintained by go mod vendor. Remove -mod=mod if you do not have a vendor directory.

$ go list -mod=mod -m -versions gopkg.in/yaml.v2 | sed 's/ v/\nv/g'
gopkg.in/yaml.v2
v2.0.0
v2.1.0
v2.1.1
v2.2.0
v2.2.1
v2.2.2
v2.2.3
v2.2.4
v2.2.5
v2.2.6
v2.2.7
v2.2.8
v2.3.0