setup-go/__tests__
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Arne Jørgensen 7d2730e317
Add support for rc and beta versions in go.mod file (#701)
* Add support for rc and beta versions in go.mod file

The regex in `parseGoVersionFile()` didn't consider rc and beta
versions. The regex has been extended.

In `findMatch()` the match is checked using `semver.satisfies()`. But
`semver.satisfies()` doesn't no about Go's non-semver rc and beta
version formats (1.16c1 instead of 1.16.0-rc.1).

We cannot use `makeSemver()` on `versionSpec` and compare the result
using `semver.satisfies()` because `versionSpec` could be, well, a
spec. Instead we first check if there is a strict match between the
candidate version and the versionSpec.

Fixes #525.

* Add support for beta versions in go.mod toolchain directive

* Support prerelease versions in the toolchain cache
2026-11-03 14:14:03 -06:00
..
data Add support for rc and beta versions in go.mod file (#701) 2026-11-03 14:14:03 -06:00
cache-restore.test.ts Migrate to ESM and upgrade dependencies (#763) 2026-07-15 15:34:36 -05:00
cache-save.test.ts Migrate to ESM and upgrade dependencies (#763) 2026-07-15 15:34:36 -05:00
cache-utils.test.ts Migrate to ESM and upgrade dependencies (#763) 2026-07-15 15:34:36 -05:00
setup-go.test.ts Add support for rc and beta versions in go.mod file (#701) 2026-11-03 14:14:03 -06:00
utils.test.ts Migrate to ESM and upgrade dependencies (#763) 2026-07-15 15:34:36 -05:00
verify-go.sh Use GitHub releases to download Go versions. (#58) 2020-06-29 11:41:13 -04:00
windows-toolcache.test.ts Migrate to ESM and upgrade dependencies (#763) 2026-07-15 15:34:36 -05:00