Skip to content
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

slices.Delete #1645

Closed
Deleplace opened this issue Sep 20, 2023 · 2 comments · Fixed by #1646
Closed

slices.Delete #1645

Deleplace opened this issue Sep 20, 2023 · 2 comments · Fixed by #1646

Comments

@Deleplace
Copy link

Deleplace commented Sep 20, 2023

Hello, while researching for this Go proposal I noticed this code:

slices.Delete(cacheEntry, i, i)

which probably doesn't behave as intended and should look like this instead:

cacheEntry = slices.Delete(cacheEntry, i, i+1)

(2 differences: using the returned value, and deleting +1 element instead of zero).

I have not tried to execute it.

@andrewpollock
Copy link
Contributor

Thank you so much for bringing this to my attention!

@Deleplace
Copy link
Author

See my comment in #1646 : i+1 as last arg would be more appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants