Skip to content

Instantly share code, notes, and snippets.

@viggy28
Created October 31, 2019 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viggy28/4fdf74a08102128663e0d9c192572a5d to your computer and use it in GitHub Desktop.
Save viggy28/4fdf74a08102128663e0d9c192572a5d to your computer and use it in GitHub Desktop.
To update a module version in a Go project.
I did go list -m -versions <module/name> eg. go list -m -versions github.com/coreos/etcd
It listed all the versions.
I did go get github.com/coreos/etcd@v3.3.17+incompatible which not only updated the etcd module, but also added a two new indirect modules and updated a bunch of checksums in go.sum
To verify that checksums (in go.sum) are as expected,
visit https://sum.golang.org/lookup/github.com/coreos/etcd@v3.3.17
and compare the values
or
go mod verify
A couple of things which I don't get
why there is such changes in go.sum? (Meaning what causes the existing modules sha sum changes)
when I issue go build ./... once again go.sum is updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment