Skip to content

Commit

Permalink
frame/reader: Remove unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav committed Aug 23, 2016
1 parent a3cbca8 commit 744414e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/frame/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package frame
import (
"bytes"
"encoding/binary"
"fmt"
"io"
"sync"
)
Expand Down Expand Up @@ -62,13 +61,10 @@ func (r *Reader) Read() ([]byte, error) {
}

var buff bytes.Buffer
copied, err := io.CopyN(&buff, r.r, length)
_, err := io.CopyN(&buff, r.r, length)
if err != nil {
return nil, err
}
if copied < length {
return nil, fmt.Errorf("unexpected end of input: expected %v bytes but got %v", length, copied)
}

return buff.Bytes(), nil
}
Expand Down

0 comments on commit 744414e

Please sign in to comment.