-
-
Notifications
You must be signed in to change notification settings - Fork 133
refactor: bump minimum required Go version to 1.23.0 #112
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the minimum required Go version to 1.23.0 and updates code paths to leverage the new filepath.Localize function, thereby eliminating the legacy use of filepath.FromSlash. Key changes include:
- Replacing filepath.FromSlash with filepath.Localize in serverCmd and cacher functions.
- Refactoring reverse iteration in tests to use slices.Backward.
- Updating the test workflow matrix to remove Go 1.22.x.
- Adjusting a logger comment to clarify the use of slog.Default with a "goproxy" group name.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
cmd/goproxy/internal/server_cmd.go | Uses filepath.Localize instead of filepath.FromSlash for path handling. |
cacher.go | Applies filepath.Localize for file path construction in Get and Put. |
goproxy_test.go | Replaces manual reverse iteration with slices.Backward. |
.github/workflows/test.yaml | Updates Go version matrix to reflect new minimal requirement. |
goproxy.go | Updates logger comment for improved clarity. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #112 +/- ##
==========================================
- Coverage 80.87% 80.65% -0.22%
==========================================
Files 11 11
Lines 1370 1370
==========================================
- Hits 1108 1105 -3
- Misses 255 257 +2
- Partials 7 8 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c152895
to
3d916d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR bumps the minimum required Go version to 1.23.0 and refactors path handling across the proxy and caching components.
- Replaces uses of filepath.FromSlash with filepath.Localize in both production and test code.
- Adds tests to validate error handling for invalid file paths.
- Updates the CI workflow to test against Go 1.23.x and 1.24.x only.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
cacher_test.go | Adds tests for Get/Put error scenarios using invalid file paths. |
cmd/goproxy/internal/server_cmd.go | Refactors Open method to use filepath.Localize instead of FromSlash. |
cacher.go | Refactors Get and Put methods with filepath.Localize for consistency. |
goproxy_test.go | Uses slices.Backward to iterate environment variables in tests. |
.github/workflows/test.yaml | Removes Go 1.22.x from the CI matrix, aligning with the new requirement. |
goproxy.go | Updates Logger comment to indicate usage of [slog.Default] with group name "goproxy". |
We always keep the minimum Go version requirement in sync with `golang.org/x/mod` to ensure we don't fall too far behind on new Go features. Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
3d916d0
to
d5eea7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request bumps the minimum required Go version to 1.23.0 to take advantage of new language features and maintain compatibility with golang.org/x/mod.
- Update goproxy_test.go to use the new slices.Backward for reverse iteration over environment variables.
- Adjust the GitHub Actions workflow in test.yaml to remove the unsupported Go version 1.22.x.
- Update a comment in goproxy.go to clarify logger behavior with the new grouping feature.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
goproxy_test.go | Replaces manual reverse iteration with slices.Backward to leverage Go 1.23.0. |
.github/workflows/test.yaml | Removes Go 1.22.x from the test matrix in favor of newer versions. |
goproxy.go | Updates the logger comment to specify the use of slog.Default with a group name. |
We always keep the minimum Go version requirement in sync with
golang.org/x/mod
to ensure we don't fall too far behind on new Go features.