batch icon indicating copy to clipboard operation
batch copied to clipboard

return number of processed items and Abort error

Open alinz opened this issue 5 years ago • 2 comments

@matryer Thanks for this little code which makes go shine.

I have decided to send a PR rather than creating an issue. I just wanted to know your opinions.

I have separate them in two commits.

The first one emphasized on returning Abort error. I feel like returning an Abort is the same as all items has been processed. There is no way to indicate whether all is done or it is been aborted.

The second commit focus on returning the number of processed items in batch. Similar to io.Reader.Read() which returns the number of bytes that has been read.

any thoughts on that? cheers

alinz avatar Feb 13 '20 21:02 alinz

@alinz I think you're absolutely right that you would want the Abort error returned. @dahernan and I discussed returning the count and I think it's a nice addition. I'll look over this tomorrow in detail. Thanks.

matryer avatar Feb 14 '20 20:02 matryer

@matryer just wanted to see if this PR worth merging? if not let's close it.

alinz avatar Feb 29 '20 22:02 alinz