setup-go icon indicating copy to clipboard operation
setup-go copied to clipboard

Make go-version-file: go.mod the default

Open andig opened this issue 1 year ago • 3 comments

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?

andig avatar Dec 21 '24 11:12 andig

Hi, @andig 👋 Thank you for the feature request, we will investigate it and get back to you as soon as we have some feedback.

mahalakshmi-rekadi avatar Dec 23 '24 07:12 mahalakshmi-rekadi

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.

Jacalz avatar Jan 21 '25 11:01 Jacalz

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?

andig avatar Jan 21 '25 11:01 andig

Seems this would still be a useful default.

andig avatar Aug 24 '25 11:08 andig