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