Skip to content

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Sep 5, 2025

Ref: #437

Our version of Go we reference in our .github/** doesn't match that in go.mod.
To fix this, I've updated the version of Go and added a check to ensure they're all in sync.

Disclaimer: Most of the script was generated by ChatGPT but I went over it before committing.

@johnstcn johnstcn self-assigned this Sep 5, 2025
@johnstcn johnstcn requested a review from mafredri September 5, 2025 09:41
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.24.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these need this to be in sync? IIRC Go will run as the version defined in go.mod even if it's a lower version. Higher version of course takes precedence.

See:

~
❯ go1.23.7 version
go version go1.23.7 darwin/arm64
~/Code/coder main*
❯ go1.23.7 version
go version go1.24.6 darwin/arm64

Btw, go.mod says 1.24.6.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actions/setup-go action has a breaking change:

Breaking Changes
Improve toolchain handling to ensure more reliable and consistent toolchain selection and management by [@​matthewhughes934](https://github.com/matthewhughes934) in [actions/setup-go#460](https://redirect.github.com/actions/setup-go/pull/460)

see #437

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, gotcha, so they're preventing that behavior now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#439 stacked the original PR on top and it's green ✅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore my comment about 1.24.6 btw, originally thought this was a PR to coder/coder repo 😄

@johnstcn johnstcn requested a review from mafredri September 5, 2025 10:43
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small suggestions/improvements but otherwise LGTM. Thanks for adding the --fix option!

@johnstcn johnstcn merged commit ac2b839 into main Sep 5, 2025
6 checks passed
@johnstcn johnstcn deleted the cj/fix-go-version branch September 5, 2025 13:36
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2025
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