beam.Copy doesn't return an error on EOF

Signed-off-by: Solomon Hykes <solomon@docker.com>
This commit is contained in:
Solomon Hykes 2014-06-06 01:38:28 +00:00
parent c7a78ae81e
commit 98818d4d39
1 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package beam
import (
"io"
"sync"
)
@ -22,6 +23,9 @@ func Copy(dst Sender, src Receiver) (int, error) {
)
for {
msg, err := src.Receive(Ret)
if err == io.EOF {
return n, nil
}
if err != nil {
return n, err
}