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

Consider dropping error result from ImmutableTree.Iterator #754

Open
elias-orijtech opened this issue May 3, 2023 · 0 comments
Open

Consider dropping error result from ImmutableTree.Iterator #754

elias-orijtech opened this issue May 3, 2023 · 0 comments

Comments

@elias-orijtech
Copy link
Contributor

elias-orijtech commented May 3, 2023

Right now every caller of ImmutableTree.Iterator must handle its error result, which in turn leads to errors being ignored:

t.Iterate(func(key []byte, val []byte) (stop bool) { //nolint:errcheck

However, the only reason an error can be returned is if IsFastCacheEnabled returns an error, which supposedly is very rare.

A better API is to fall back to NewIterator when IsFastCacheEnabled fails and remove the error result. This benefits every caller, direct and indirect.

CC @odeke-em

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