Skip to content

Commit

Permalink
Remove simulator buf.Write error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman committed Mar 9, 2023
1 parent 2d2eb44 commit 63181f2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions simulator/simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,8 @@ func (s *Simulator) Write(commandBuffer []byte) (int, error) {
if err != nil {
return 0, err
}
n, err := s.buf.Write(resp)
if err != nil {
return 0, err
}
if n != len(resp) {
return 0, fmt.Errorf("expected %d bytes to be written to command response buffer, but actual number is %d", len(resp), n)
}
// write response to the internal response buffer.
_, _ = s.buf.Write(resp)
return len(commandBuffer), nil
}

Expand Down

0 comments on commit 63181f2

Please sign in to comment.