Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow setting Go version from go.mod file #46

@bewuethr

Description

@bewuethr

setup-go supports setting the Go version from the go.mod file; for Go 1.20 and older, it'll use the latest cached patch version on the same minor version, and for Go 1.21+, it'll use the exact version from go.mod, which now also includes the patch version.

Would it be possible to expose the go-version-file input in gh-extension-precompile as well? I previously extracted the Go version in a separate run step with go mod edit -json | jq -r '.Go', but that breaks if go.mod uses 1.21.0 or later, since the default Go on Actions runners, 1.20.8, considers the go.mod incorrectly formatted. I now use awk, which is less robust, but it would be nice to just leverage the existing setup-go functionality.

Happy to create a PR for this if there's interest, potentially including the check-latest flag from setup-go as well.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions