Skip to content

Commit

Permalink
remove unused assignments / use errs
Browse files Browse the repository at this point in the history
  • Loading branch information
djherbis committed Sep 2, 2019
1 parent 77abcdd commit c0b8778
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func (buf *fileBuffer) UnmarshalBinary(data []byte) error {
var filename string
var N, L, O int64
_, err := fmt.Fscanln(buffer, &filename)
if err != nil {
return err
}

file, err := os.Open(filename)
if err != nil {
Expand Down
4 changes: 1 addition & 3 deletions partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ func (buf *partition) Write(p []byte) (n int, err error) {
n += m
p = p[m:]

if er == io.ErrShortWrite {
er = nil
} else if er != nil {
if er != nil && er != io.ErrShortWrite {
return n, er
}

Expand Down
4 changes: 1 addition & 3 deletions partition_at.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ func (buf *partitionAt) Write(p []byte) (n int, err error) {
n += m
p = p[m:]

if er == io.ErrShortWrite {
er = nil
} else if er != nil {
if er != nil && er != io.ErrShortWrite {
return n, er
}

Expand Down

0 comments on commit c0b8778

Please sign in to comment.