Skip to content

Indexing bug in batchItems slicing #3

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

Open
IsmailAfiff opened this issue May 6, 2021 · 3 comments
Open

Indexing bug in batchItems slicing #3

IsmailAfiff opened this issue May 6, 2021 · 3 comments

Comments

@IsmailAfiff
Copy link

IsmailAfiff commented May 6, 2021

In the tutorial, the usage of the function is batchItems := items[start:end].
Golang slice is exclusive meaning the end is not included in the slice, therefore it should be batchItems := items[start:end+1].

@IsmailAfiff IsmailAfiff changed the title Indexing bug in slicing batchItems Indexing bug in batchItems slicing May 6, 2021
@adityathebe
Copy link

You mean :end+1] ?

@IsmailAfiff
Copy link
Author

Yap you're right it should be :end+1

@RyanBalfanz
Copy link

Any plans to either update the blog post or fix the issue here directly.

I of course understand that it's a breaking change and so probably not ideal, despite my shared thinking that [start:end] is the correct and assumed treatment regardless of what the blog post says, others may disagree. So, updating the post seems worthwhile to IMHO.

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

3 participants