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

chore: return errors using channels and not embedded in result type #10527

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gammazero
Copy link
Contributor

Asynchronous functions should return errors over channels instead of embedding the error in the result type.

Closes #9974

Asynchronous functions should return errors over channels instead of embedding the error in the result type.

Closes #9974
}

func (api *UnixfsAPI) lsFromLinks(ctx context.Context, ndlinks []*ipld.Link, settings *options.UnixfsLsSettings) (<-chan coreiface.DirEntry, error) {
links := make(chan coreiface.DirEntry, len(ndlinks))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this: Using a channel instead of a slice, just to confirm to an interface, seems like a bad idea.

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

Successfully merging this pull request may close these issues.

kubo/client/rpc: use error channels
1 participant