Skip to content

Conversation

aofei
Copy link
Member

@aofei aofei commented Mar 15, 2025

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.

@aofei aofei requested a review from Copilot March 15, 2025 02:41
Copy link

@Copilot Copilot AI left a 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.

Copy link

codecov bot commented Mar 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.65%. Comparing base (5b2a4c8) to head (d5eea7b).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aofei aofei force-pushed the minimum-go-version branch from c152895 to 3d916d0 Compare March 15, 2025 02:56
@aofei aofei requested a review from Copilot March 15, 2025 02:57
Copy link

@Copilot Copilot AI left a 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>
@aofei aofei force-pushed the minimum-go-version branch from 3d916d0 to d5eea7b Compare March 15, 2025 03:15
@aofei aofei requested a review from Copilot March 15, 2025 03:15
Copy link

@Copilot Copilot AI left a 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.

@aofei aofei merged commit f1c66d7 into goproxy:master Mar 15, 2025
6 of 7 checks passed
@aofei aofei deleted the minimum-go-version branch March 15, 2025 03:22
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.

1 participant