Conversation
…nize@latest -fix -test ./...
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #588 +/- ##
=======================================
Coverage 85.75% 85.75%
=======================================
Files 39 39
Lines 2282 2282
=======================================
Hits 1957 1957
Misses 300 300
Partials 25 25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes Go code by replacing interface{} with the more idiomatic any type alias introduced in Go 1.18, and updates loop constructs to use range expressions where appropriate.
- Replaces all instances of
interface{}withanyacross function parameters, struct fields, and type declarations - Updates traditional for loops to use
for range Nsyntax for simple iteration patterns - Updates dependency versions in go.work.sum
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| mock/mock.go | Replace interface{} with any in Mock struct fields and method signatures |
| mock/mock_test.go | Update test function parameter from interface{} to any |
| log/log.go | Replace interface{} with any in logging function variadic parameters |
| log/log_test.go | Update loop syntax and replace interface{} with any in test data |
| log/http.go | Update endpoint function signature to use any |
| log/http_test.go | Update test endpoint function signature |
| log/grpc.go | Replace interface{} with any in gRPC interceptor function signatures |
| log/format.go | Update JSON array formatting function parameter |
| log/format_test.go | Replace interface{} with any in test slice declarations |
| log/fields.go | Update KV struct and Fields type to use any |
| log/adapt.go | Replace interface{} with any in adapter function signatures and update loop syntax |
| debug/options.go | Update FormatFunc type and function signatures |
| debug/grpc.go | Replace interface{} with any in gRPC interceptor signatures |
| debug/debug.go | Update endpoint wrapper function signature |
| debug/debug_test.go | Update test function parameter type |
| go.work.sum | Add new dependency version entries |
Member
|
This is great, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://pkg.go.dev/golang.org/x/tools/gopls@v0.20.0/internal/analysis/modernize