Repository navigation
Add support for native Go version syntax in go-version input - #804
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The implementation, executable bundle, tests, and documentation consistently support the stated behavior, with no unresolved blocking findings.
No open issues 🎉
What changed in this PR
Adds native Go version syntax to go-version, addressing the manual version conversion described in issue #63 while preserving existing SemVer and version-file behavior.
Changes:
- Validates native Go versions and normalizes them to SemVer, unless a custom download base URL is configured.
- Adds tests for validation, normalization, downloads, and custom-URL passthrough.
- Updates documentation, input metadata, and the executable bundle.
| File | Description |
|---|---|
| src/main.ts | Validates and normalizes native Go version inputs. |
| src/installer.ts | Adds native Go version format validation. |
| README.md | Documents supported syntax and custom-URL behavior. |
| docs/advanced-usage.md | Explains normalization and exact-version matching. |
| dist/setup/index.js | Includes the implementation in the executable bundle. |
| action.yml | Advertises native Go version support. |
| tests/setup-go.test.ts | Covers accepted formats, rejection, normalization, downloads, and passthrough. |
Review effort: Balanced
qmuntal
left a comment
There was a problem hiding this comment.
Could we also support native Go versions with custom download URLs? We could normalize the version for matching and cache lookups while preserving the original input when constructing download filenames. That would keep existing URLs working and avoid making version syntax depend on the download source
|
Thank you, @qmuntal, for your feedback. Native Go versions already worked for direct downloads from custom URLs. I’ve updated the code to also normalize them to SemVer for matching and tool-cache lookups, while preserving the original input for constructing download URLs. This enables cache reuse without changing existing download URLs. Tests and documentation have also been updated. Could you please review the changes when you have a chance? |
Description:
This PR adds support for Go-native version syntax (
go1.21,go1.21.5,go1.18beta2,go1.21rc2) in thego-versioninput. Supported inputs are normalized to SemVer for matching and cache lookups. Without a custom download URL, malformed Go-native inputs such asgo1.21.xfail with a clear error. For custom download URLs, the original input is preserved when constructing direct-download filenames. Existing SemVer inputs remain supported.Related issue:
#63
Check list: