Skip to content

refactor: Simplify array copying#4143

Merged
gmlewis merged 1 commit intogoogle:masterfrom
alexandear-org:refactor/array-copy
Apr 10, 2026
Merged

refactor: Simplify array copying#4143
gmlewis merged 1 commit intogoogle:masterfrom
alexandear-org:refactor/array-copy

Conversation

@alexandear
Copy link
Copy Markdown
Contributor

Arrays in Go are value types, so clone.rateLimits = c.rateLimits copies all elements by value. It's equivalent to the copy call but without the [:] slice conversion overhead.

The [32]byte(slice) conversion is available since Go 1.20 and replaces the var declaration + copy with a single line.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.75%. Comparing base (5124fac) to head (2ab00a7).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...xample/codespaces/newreposecretwithxcrypto/main.go 0.00% 1 Missing ⚠️
...xample/codespaces/newusersecretwithxcrypto/main.go 0.00% 1 Missing ⚠️
example/newreposecretwithxcrypto/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4143      +/-   ##
==========================================
+ Coverage   93.74%   93.75%   +0.01%     
==========================================
  Files         211      211              
  Lines       19685    19682       -3     
==========================================
  Hits        18453    18453              
+ Misses       1034     1031       -3     
  Partials      198      198              

☔ 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.

Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @alexandear!
LGTM.
Merging.

@gmlewis gmlewis merged commit c13f52c into google:master Apr 10, 2026
7 of 8 checks passed
@alexandear alexandear deleted the refactor/array-copy branch April 10, 2026 06:36
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