Skip to content

check-latest doesn't work for go.mod file with patch version in go line #713

@DmitriyLewen

Description

@DmitriyLewen

Description:
When the go.mod file uses a patch version in the go line, setup-go installs this version even when the check-latest option is used.
However, the go line only indicates the minimum Go version required for the project.
You can see our tests here - aquasecurity/trivy#7163 (comment)

Action version:
tested with:

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
go 1.25.4 from go.mod file.

Repro steps:

  1. Set go path version in go.mod file
  2. Use the following options:
    2.1. go-version-file: go.mod
    2.2. check-latest: true

You can see test run in my test repo - https://github.com/DmitriyLewen/test-setup-go-flags/actions/runs/21582509578/job/62182731321

Expected behavior:
setup latest go version (1.25.6 now).

Actual behavior:
1.25.4 version has been installed

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions