Make go-version-file: go.mod the default
Description: Currently, I have to add
with:
go-version-file: go.mod
for all builds to specify a go version. Instead, the "default" go version that any go program would use is the one from the go.mod with fallback to the installed go version. This should be the default for setup-go, too.
Justification: Simplify developer's life.
Are you willing to submit a PR?
Hi, @andig 👋 Thank you for the feature request, we will investigate it and get back to you as soon as we have some feedback.
This seems like a helpful change. If not Go version is specified we load the one from the module and anyone that wants to test oldest supported and newest, we can do something like https://github.com/actions/setup-go/issues/450.
Thinking about it I'm no longer too happy with this request. If go.mod specifies the minimum version- and the go command will upgrade to that toolchain if not already installed- then the version for compiling should be the current stable version. It is just not entirely clear to me, what the default version of setup-go even is if no version is specified?
Seems this would still be a useful default.