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

Bug: Panic when the Slice() accepts a negative index #255

Closed
Bin-Huang opened this issue Oct 26, 2022 · 1 comment
Closed

Bug: Panic when the Slice() accepts a negative index #255

Bin-Huang opened this issue Oct 26, 2022 · 1 comment

Comments

@Bin-Huang
Copy link
Contributor

lo.Slice(arr, -1, 10) // panic: runtime error: slice bounds out of range

I think that compared to the native method(arr[1:10]), the meaning of lo.Slice() is to avoid panic caused by out-of-bounds as much as possible.

I would love to fix it.

@Bin-Huang
Copy link
Contributor Author

Bin-Huang commented Oct 26, 2022

Pull Review: #256

@samber samber closed this as completed Nov 15, 2022
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

No branches or pull requests

2 participants