Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update go version #1339

Conversation

danielperaltamadriz
Copy link

Description

Fixes #1337.

Update Golang version to 1.21.1

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Update Golang version to 1.21.1
Added / Removed / Updated [X].

@denis256
Copy link
Member

Noticed failing tests:

TestIntegrationBasicExample

Failed
<property name="go.version" value="go1.21.1"></property>
		<property name="go.version" value="go1.19"></property>
integration_test.go:51: 
Error Trace:	/home/circleci/project/modules/logger/parser/integration_test.go:51
            				/home/circleci/project/modules/logger/parser/integration_test.go:61
Error:      	Should be true
Test:       	TestIntegrationFailingExample


TestIntegrationPanicExample

Failed
<property name="go.version" value="go1.21.1"></property>
		<property name="go.version" value="go1.19"></property>
integration_test.go:51: 
Error Trace:	/home/circleci/project/modules/logger/parser/integration_test.go:51
            				/home/circleci/project/modules/logger/parser/integration_test.go:56
Error:      	Should be true
Test:       	TestIntegrationBasicExample

TestIntegrationNewGoExample

Failed
<property name="go.version" value="go1.21.1"></property>
		<property name="go.version" value="go1.19"></property>
integration_test.go:51: 
Error Trace:	/home/circleci/project/modules/logger/parser/integration_test.go:51
            				/home/circleci/project/modules/logger/parser/integration_test.go:66
Error:      	Should be true
Test:       	TestIntegrationPanicExample

@denis256 denis256 merged commit af9ab8c into gruntwork-io:master Sep 18, 2023
2 of 3 checks passed
@danielperaltamadriz danielperaltamadriz deleted the feature/update-go-version-1337 branch September 18, 2023 18:46
@@ -1,6 +1,6 @@
module github.com/gruntwork-io/terratest

go 1.19
go 1.21.1
Copy link
Contributor

Choose a reason for hiding this comment

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

that is quite unusual to have a patch version requirement in the go.mod (go 1.21.1 instead of go 1.21).
it also means that all projects that import github.com/gruntwork-io/terratest will need to have the same requirement, and their go.mod file will be mutated when running go mod tidy.
is there a specific reason for the strict requirement?

Choose a reason for hiding this comment

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

Hi, as far as I understand, the strict requirement is done by golang since the 1.21 version. Even if the go.mod file only has 1.21, it implies that all the modules that depend on this need to have at least go 1.21.0 installed.
https://tip.golang.org/doc/toolchain#config

In regards to the add of the patch version, since 1.21 the go toolchain requires the patch version as part of the name, so to avoid issues is recommended to add the patch as part of the go.mod version
golang/go#62278

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the link. I was not aware of this change in go 1.21. But based on the discussion there, it feels like the go directive here should be go 1.21.0, and not go 1.21.1, which forces all modules using this one to also use go 1.21.1.

Choose a reason for hiding this comment

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

I chose 1.21.1 because it was the latest version at that moment, but sure, I'll submit a PR to downgrade the version to 1.21.0.

Choose a reason for hiding this comment

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

PR: #1349

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants