Embrace native toolchain management introduced in Go 1.21.0. Moreover do not rely on the hardcoded Go version in GH workflows that has to be updated manually, use the version defined in go.mod instead, read more.
To conclude when a new version of Go is released only update in go.mod to have the newest (and the same) version everywhere used (even locally).
Special notes for your reviewer:
Probably in the future usage of actions/setup-go@v4 to set version based on go.mod can be ditched too, because the Go toolchain ensures the right version automatically. For now, it's required because GH runners have an older version of Go that does not support toolchain features.
What this PR does / why we need it:
Embrace native toolchain management introduced in Go 1.21.0. Moreover do not rely on the hardcoded Go version in GH workflows that has to be updated manually, use the version defined in
go.mod
instead, read more.To conclude when a new version of Go is released only update in
go.mod
to have the newest (and the same) version everywhere used (even locally).Special notes for your reviewer:
Probably in the future usage of
actions/setup-go@v4
to set version based ongo.mod
can be ditched too, because the Go toolchain ensures the right version automatically. For now, it's required because GH runners have an older version of Go that does not support toolchain features.