Skip to content

Instantly share code, notes, and snippets.

@jesugmz
Last active March 7, 2025 12:38
Show Gist options
  • Save jesugmz/09fb2a75b743de3502fbde385e72f10a to your computer and use it in GitHub Desktop.
Save jesugmz/09fb2a75b743de3502fbde385e72f10a to your computer and use it in GitHub Desktop.
Edit go version and update modules

Edit go version in go.mod

go mod edit -go=<GO_VERSION>

Example:

go mod edit -go=1.24

After this change is recommended to clean up potential unnecesary packages:

go mod tidy

https://pkg.go.dev/cmd/go#hdr-Edit_go_mod_from_tools_or_scripts

Update go.mod packages

go get -u ./...
go mod tidy

Might be necessary to synchronize vendor to synchronize changes:

go mod vendor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment