-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: affected/package: slices #61252
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
Comments
1 and 2 were previously rejected, see #47203 (comment). |
Delete is a bug function, are you serious? s := []int{0, 1, 2}
fmt.Println(slices.Delete(s, 1, 2)) // [0,2]
fmt.Println(s) // [0,2,2] Terrifying! I don't think that `s` become [0,2,2] is your want!!!
// BTW! If you do not accept the proposal, please also modify the Delete function. maybe like this:
r = make(S, len(s)-1)
copy(r, s[:i])
copy(r[i:], s[i+1:]) |
|
We plan to first develop a plan for iterators (see the earlier discussion at #54245). Once we understand whether or how iterators should be available in Go, we can consider what a general |
HI! In order to improve development efficiency, I believe it is necessary to provide more popular array slices functions, including but not limited to the following item:
Looking forward to your reply.
The text was updated successfully, but these errors were encountered: