batch
batch copied to clipboard
Indexing bug in batchItems slicing
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]
.
You mean :end+1] ?
Yap you're right it should be :end+1
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.