Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
go mod update

If you use cgo, then a lot of go module tools get really slow per golang/go#29427

For example, this is really slow:

go list -m -u all

Maybe Instead:

$ go list -m -f '{{if not (or .Indirect .Main)}}{{.Path}}{{end}}' all

$ go list -m -versions v0.1.0 v0.1.1

$ go list -m v0.1.1

Stupid pet tricks:

go list -m -f '{{if not (or .Indirect .Main)}}go get -d {{.Path}}@latest{{end}}' all

However, any packages pinned to unreleased versions will be downgraded.

Those are set to latest by:

go get -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment