Skip to content

chore: allow CI to use latest Go patch updates by relaxing version check#496

Merged
matifali merged 2 commits intomainfrom
fix/go-version-check
Mar 25, 2026
Merged

chore: allow CI to use latest Go patch updates by relaxing version check#496
matifali merged 2 commits intomainfrom
fix/go-version-check

Conversation

@matifali
Copy link
Member

@matifali matifali commented Mar 25, 2026

Stack: main#496#498
Merge #498 into this branch first, then merge this PR into main.


Summary

  • go.mod now uses go 1.25.0 — Go 1.21+ requires a full major.minor.patch version; without the patch, go fmt normalizes it to .0 anyway
  • check_go_version.sh now compares only major.minor when validating workflow go-version values, so workflows can keep using go-version: "1.25" which lets actions/setup-go automatically resolve the latest 1.25.x patch — previously, the exact-match check would fail because 1.25 != 1.25.0

Test plan

  • CI Lint fmt passes (go.mod is valid)
  • CI Check Go Versions passes (major.minor comparison succeeds)
  • --fix flag updates workflows to major.minor format correctly

go.mod requires a full major.minor.patch version since Go 1.21, so
`go 1.25` must be `go 1.25.0`. Update check_go_version.sh to strip
the patch when comparing against workflow go-version values, allowing
workflows to use `go-version: "1.25"` (which actions/setup-go resolves
to the latest 1.25.x patch) without the version check failing.
@matifali matifali changed the title fix: allow CI to use latest Go patch updates chore: allow CI to use latest Go patch updates by relaxing version check Mar 25, 2026
@matifali matifali requested a review from johnstcn March 25, 2026 08:45
…nky promise (#498)

Replace the GitHub API prerelease boolean check with semver.Version.Prerelease()
filtering — because the version string is the source of truth, not metadata.

Also:
- Extract highestRelease() to eliminate 3x copy-pasted loops
- Extract formatVersion() for the repeated Sprintf pattern
- Fix pre-existing bug: missing continue after semver parse errors
  caused stale version from prior iteration to be used
- Add table-driven tests for both helpers (there were none before)
@matifali matifali merged commit 4c18b7a into main Mar 25, 2026
7 checks passed
@matifali matifali deleted the fix/go-version-check branch March 25, 2026 14:15
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants