-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
add: Fix adding multiple files #6255
Conversation
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'd like to reconsider how we're doing events (ideally, we'd be able to reuse the channel) but we can handle that in a followup PR.
_, dir := addit.Node().(files.Directory) | ||
errCh := make(chan error, 1) | ||
events := make(chan interface{}, adderOutChanSize) | ||
opts[len(opts)-1] = options.Unixfs.Events(events) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we shouldn't be closing this channel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, we could drop the need for the nil option by writing:
opts := append(opts, options.Unixfs.Events(events)) // note the :=
See #6254