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 to go 1.20 #5217

Merged
merged 6 commits into from
May 8, 2023
Merged

upgrade to go 1.20 #5217

merged 6 commits into from
May 8, 2023

Conversation

et
Copy link
Contributor

@et et commented May 2, 2023

Need to upgrade?

Homebrew

brew install go@1.20

Other Go installations

https://go.dev/dl

Summary

This PR upgrades us to Go 1.20 (release notes). The reasoning behind the upgrade is obviously to be on the latest and greatest but also to help prove we don't need the deprecated github.com/pkg/errors library. Specifically, Go 1.20 has a built-in errors.Join function that does what the errors.Wrap function was doing.

As we have discussed over slack, Go error wrapping is unnecessary assuming there's an associated stack trace. Long term, I still plan on removing all of the error wrapping in our code base but wanted to make that distinct from the Go upgrade.

How did you test this change?

Updated our docs to reflect that Go 1.20 is now the minimum version. We don't specify how to install Go but for most of us, it's probably brew install go@1.20 (other versions here) and restart the backend.

I did a basic click test and didn't observe any issues. I didn't notice any breaking changes from the release notes either.

Are there any deployment considerations?

N/A

@et et linked an issue May 2, 2023 that may be closed by this pull request
@et et marked this pull request as ready for review May 3, 2023 18:58
@et et requested review from a team, ccschmitz and Vadman97 and removed request for a team May 3, 2023 18:58
Copy link
Member

@Vadman97 Vadman97 left a comment

Choose a reason for hiding this comment

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

could we also update the CI version to be consistent? mind checking the .github/workflows files

@et
Copy link
Contributor Author

et commented May 5, 2023

could we also update the CI version to be consistent? mind checking the .github/workflows files

Correct me if I'm wrong but isn't it using the same thing?

with:
go-version-file: 'backend/go.mod'

@et et requested a review from Vadman97 May 5, 2023 18:53
@ccschmitz
Copy link
Contributor

Correct me if I'm wrong but isn't it using the same thing?

@et I think there are still some CI files where we are hard-coded to 1.19.

https://github.com/search?q=repo%3Ahighlight%2Fhighlight+%271.19%27&type=code

Looks good to me otherwise - thanks for upgrading us!

@et
Copy link
Contributor Author

et commented May 5, 2023

@et I think there are still some CI files where we are hard-coded to 1.19.

Nice find. I think I got the rest in bb84a5b and 86dab35

Copy link
Member

@Vadman97 Vadman97 left a comment

Choose a reason for hiding this comment

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

cool, thanks eric! looks like updating the go version in the lint caught some important bugs ;)

@et
Copy link
Contributor Author

et commented May 8, 2023

cool, thanks eric! looks like updating the go version in the lint caught some important bugs ;)

Indeed. Just pushed some changes to fix some rand deprecation warnings.

@et et merged commit 5fd4949 into main May 8, 2023
@et et deleted the 5216-upgrade-go-to-120 branch May 8, 2023 15:25
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.

Upgrade go to 1.20
3 participants