-
Notifications
You must be signed in to change notification settings - Fork 396
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 #1288
Conversation
Thanks for the PR. Right now it indeed seems that we initialize the nodes differently. I'll further check if we don't somehow assume that first |
I have searched many Go repositories, and this is a common issue. I am trying to solve it at the Go toolchain level |
Interesting! Imo it is a very good find. Indeed we have based our profiling implementation on the Go standard one, but capturing different metrics. |
Thank you for your recognition! I am preparing to add a detection item in go vet to avoid this issue. In the future, it may only be necessary to update the Go version, as there will be relevant detection items in the latest toolchain |
I checked - in gnark this code path is never called and cannot be called without modifying the internal implementation. And even if it is initalized incorrectly, then later in Thanks for reporting! |
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.
LGTM!
Description
The intention here should be to initialize a slice with a capacity of
len(prof.Location)
rather than initializing the length of this slice.The online demo: https://go.dev/play/p/q1BcVCmvidW
Type of change
How has this been tested?
How has this been benchmarked?
Checklist:
golangci-lint
does not output errors locally