Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tchssk
Copy link
Member

@tchssk tchssk commented Aug 1, 2025

@tchssk tchssk marked this pull request as ready for review August 2, 2025 05:15
@tchssk tchssk requested a review from Copilot August 2, 2025 05:15
Copy link
Contributor

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 applies modernization improvements to the codebase using the Go modernize tool. The changes leverage newer Go standard library features and language constructs to improve code clarity and maintainability.

  • Replace manual loop-based searches with slices.Contains() for cleaner array/slice membership checks
  • Use maps.Copy() instead of manual map copying loops for better performance and readability
  • Modernize for-loop syntax using range-over-integer pattern available in Go 1.22+
  • Replace interface{} with the more modern any type alias
  • Use min() builtin function and other standard library improvements

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
security/scheme.go Replaces manual slice search with slices.Contains() for scope validation
middleware/xray/segment.go Consolidates function parameters, uses min() builtin, and modernizes for-loop syntax
middleware/sampler_test.go Updates for-loops to use range-over-integer syntax
http/middleware/xray/segment_test.go Uses http.NoBody and modernizes for-loop syntax
http/codegen/sse_client.go Replaces interface{} with any type alias
http/codegen/sse.go Replaces interface{} with any type alias
http/codegen/openapi/v3/types_test.go Updates function parameter type from interface{} to any
http/codegen/openapi/v3/parameters.go Replaces manual slice search with slices.Contains()
http/codegen/openapi/v3/builder.go Uses maps.Copy() instead of manual map copying
http/codegen/openapi/v2/builder.go Uses maps.Copy() and slices.Contains() for cleaner code
http/codegen/openapi/marshal.go Replaces manual map copying with maps.Copy()
http/codegen/openapi/extensions.go Uses maps.Copy() for map merging operations
http/client.go Uses fmt.Appendf() instead of manual slice formatting
grpc/middleware/xray/segment_test.go Modernizes for-loop syntax
expr/types.go Updates for-loops to use range-over-integer syntax
expr/server.go Replaces manual slice searches with slices.Contains()
expr/root.go Uses maps.Copy() and slices.Contains() for cleaner code
expr/mapped_attribute.go Uses maps.Copy() for map duplication
expr/http_endpoint_test.go Modernizes for-loop syntax
expr/http_endpoint.go Replaces multiple manual slice searches with slices.Contains()
expr/grpc_endpoint.go Uses slices.Contains() for cleaner membership checks
expr/example.go Uses min() builtin, modernizes for-loops, and renames shadowed variables
expr/attribute.go Replaces manual slice searches with slices.Contains()
dsl/result_type.go Uses built-in copy() function for slice copying
dsl/meta_test.go Uses slices.Contains() in test helper function
codegen/service/service_data.go Replaces manual slice search with slices.Contains()
codegen/service/interceptors.go Replaces interface{} with any type alias
codegen/funcs.go Consolidates function parameters and modernizes for-loop syntax
codegen/file.go Uses maps.Copy() and updates file permissions to be more restrictive

@raphael
Copy link
Member

raphael commented Aug 7, 2025

This is great, thank you!

@raphael raphael merged commit 0dbdae1 into v3 Aug 7, 2025
9 checks passed
@raphael raphael deleted the modernize branch August 7, 2025 00:05
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.

2 participants