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
go get -u ./...
go mod tidy
Might be necessary to synchronize vendor to synchronize changes:
go mod vendor
go get <PACKAGE_URI>@v<PACKAGE_VERSION>
Example:
go get gopkg.in/DataDog/[email protected]
After this change, use tidy and sync vendor:
go mod tidy
go mod vendor