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

Upgrade Golang to 1.17.1 #11251

Merged
merged 3 commits into from
Oct 4, 2021
Merged

Upgrade Golang to 1.17.1 #11251

merged 3 commits into from
Oct 4, 2021

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Oct 1, 2021

Also, ran gofmt on all files, mostly to handle the new build directives noted in Go 1.17 release notes

//go:build lines

The go command now understands //go:build lines and prefers them over // +build lines. The new syntax uses boolean expressions, just like Go, and should be less error-prone. As of this release, the new syntax is fully supported, and all Go files should be updated to have both forms with the same meaning. To aid in migration, gofmt now automatically synchronizes the two forms. For more details on the syntax and migration plan, see https://golang.org/design/draft-gobuild.

https://golang.org/doc/go1.17 .

gofmt changed few other constructs, namely initializations. I ran find . -type f -name '*.go' -exec gofmt -s -w {} \;.

Closes #11153

Mahmood Ali added 2 commits October 1, 2021 09:41
mostly to handle build directives in 1.17.
Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

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

Thanks! Looks like all of the changes shouldn't make CI or builds unhappy for Nomad v1.0.x (Go 1.15) if they get pulled in by a backport. Was a little worried about that, but I should have trusted the Go team to do a good job of taking backward compatibility into consideration.

Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

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

Oops could use a mention of 1.2.0 -> 1.17 here: https://github.com/hashicorp/nomad/blob/main/contributing/golang.md

Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

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

Oops, don't forget a changelog like:

  • build: Updated to Go 1.15.13 [GH-10734]

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2022
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.

upgrade to go 1.17
2 participants