io.Copy surprisingly returns the number of bytes it copies so we need to explicitly ignore that.

This commit is contained in:
David Sisson 2017-04-29 18:45:45 -07:00
parent 81b8078860
commit fc8b14b1dc
1 changed files with 2 additions and 2 deletions

View File

@ -28,9 +28,9 @@ func NewFileStream(fileName string) (*FileStream, error) {
return nil, err
}
defer f.Close()
err = io.Copy(buf, f)
_, err = io.Copy(buf, f)
if err != nil {
return nil, er
return nil, err
}
fs := new(FileStream)