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

chore(go.mod): bump to go 1.22 #1255

Merged
merged 1 commit into from
Jan 4, 2025
Merged

chore(go.mod): bump to go 1.22 #1255

merged 1 commit into from
Jan 4, 2025

Conversation

abhinav
Copy link
Collaborator

@abhinav abhinav commented Jan 3, 2025

Go 1.22 is the minimum supported Go version right now.
Bump the constraint in go.mod to reflect that,
and also pick up the for loop semantics change made in Go 1.22.

Without this, go vet (correctly) fails with:

Error: app_test.go:441:6: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:451:26: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:466:7: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:473:7: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:479:6: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:546:7: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:559:8: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:574:6: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:597:22: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:604:8: loopclosure: loop variable tt captured by func literal (govet)

@abhinav
Copy link
Collaborator Author

abhinav commented Jan 3, 2025

This change is part of the following stack:

Change managed by git-spice.

Go 1.22 is the minimum supported Go version right now.
Bump the constraint in go.mod to reflect that,
and also pick up the `for` loop semantic changes made in Go 1.22 [1].

  [1]: https://go.dev/blog/loopvar-preview

Without this, `go vet` fails on the latest Go with:

```
Error: app_test.go:441:6: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:451:26: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:466:7: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:473:7: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:479:6: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:546:7: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:559:8: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:574:6: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:597:22: loopclosure: loop variable tt captured by func literal (govet)
Error: app_test.go:604:8: loopclosure: loop variable tt captured by func literal (govet)
```
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.62%. Comparing base (8610112) to head (cd619cb).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1255      +/-   ##
==========================================
+ Coverage   98.42%   98.62%   +0.19%     
==========================================
  Files          35       35              
  Lines        2924     3336     +412     
==========================================
+ Hits         2878     3290     +412     
- Misses         38       39       +1     
+ Partials        8        7       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sywhang sywhang merged commit aa85ee9 into master Jan 4, 2025
19 checks passed
@sywhang sywhang deleted the abg/go-122 branch January 4, 2025 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants