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

No way to get the error happening in HasNext #1

Open
matdurand opened this issue Feb 21, 2022 · 0 comments
Open

No way to get the error happening in HasNext #1

matdurand opened this issue Feb 21, 2022 · 0 comments

Comments

@matdurand
Copy link

Hi,

I would argue that the following line should return "true" (https://github.com/calvernaz/go-iterators/blob/master/iterator.go#L77)

My reasoning is that if it returns false, there is no way to tell if it's because there is no more element, or if there was an error. If it was to return true, then we would call .Next() to get the next and would receive (nil, someErr), which would allow us to deal with the err.

What do you think?

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

1 participant