-
Notifications
You must be signed in to change notification settings - Fork 328
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
fix: fix slice init length #4412
Conversation
Thanks for the review. Anything need I to do? |
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.
Good catch, and curious about how to detect these issues?
Thanks for your review. I have encountered many similar cases and developed a tool. I submitted a proposal a few days ago. If you are interested, please take a look. golang/go#69872 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4412 +/- ##
==========================================
- Coverage 74.83% 74.73% -0.11%
==========================================
Files 378 378
Lines 31624 31719 +95
==========================================
+ Hits 23666 23704 +38
- Misses 6747 6799 +52
- Partials 1211 1216 +5 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
Description
The intention here should be to initialize a slice with a capacity of
len(deviceArr)
rather than initializing the length of this slice.The online demo: https://go.dev/play/p/q1BcVCmvidW
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: