Skip to content

Conversation

suzuki-shunsuke
Copy link
Member

@suzuki-shunsuke suzuki-shunsuke commented Jan 25, 2024

Close #2730

From Go 1.21, the version of Go is decided by go directive in go.mod or go.work.

e.g.

module github.com/aquaproj/aqua/v2

go 1.22.3

This can cause an issue that the version of Go may be different from the version defined in aqua.yaml.
And we need to define go version in two places.

To solve the issue, this pull request enables aqua to get the version of go from go directive in go.mod or go.work.
You can specify the path to go.mod or go.work by a field go_version_file.

e.g.

packages:
- name: golang/go
  go_version_file: go.mod

Then you can define go version only in go.mod or go.work.

Caution

The version of Go must be a semver x.y.z.
You can't omit a patch version.

@suzuki-shunsuke suzuki-shunsuke added the enhancement New feature or request label May 10, 2024
@suzuki-shunsuke suzuki-shunsuke added this to the v2.27.5 milestone May 10, 2024
@suzuki-shunsuke suzuki-shunsuke marked this pull request as ready for review May 10, 2024 23:31
@suzuki-shunsuke suzuki-shunsuke merged commit d9821e4 into main May 10, 2024
@suzuki-shunsuke suzuki-shunsuke deleted the feat-go-version-file branch May 10, 2024 23:52
@suzuki-shunsuke suzuki-shunsuke changed the title feat: add an option go-version-file feat: add an option go_version_file May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support getting Go version from go.mod
1 participant