Skip to content
This repository was archived by the owner on Apr 10, 2026. It is now read-only.

fix: fix slice init length#1577

Open
vetclippy wants to merge 1 commit into
cosmos:mainfrom
vetclippy:main
Open

fix: fix slice init length#1577
vetclippy wants to merge 1 commit into
cosmos:mainfrom
vetclippy:main

Conversation

@vetclippy

Copy link
Copy Markdown

The purpose here should be to initialize a slice with a capacity of len(call.Arguments) and a length of 0, and then append it later. Instead of initializing the length to len(call.Arguments) from the beginning, the resulting slice will not meet expectations.

The online demo: https://go.dev/play/p/q1BcVCmvidW

Signed-off-by: vetclippy <vetclippy@icloud.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant