-
Notifications
You must be signed in to change notification settings - Fork 279
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 #19139
base: main
Are you sure you want to change the base?
fix: fix slice init length #19139
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
friendly ping~ |
User description
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
The intention here should be to initialize a slice with a capacity of length rather than initializing the length of this slice.
The online demo: https://go.dev/play/p/q1BcVCmvidW
PR Type
Bug fix
Description
snapshot.go
file.exportPath
,snapshotPath
, andInit
methods to correctly initialize slices with a capacity.Changes walkthrough 📝
snapshot.go
Correct slice initialization to use capacity
pkg/logservice/snapshot.go
exportPath
,snapshotPath
, andInit
methods.