From 63181f25ddcd7347aaef664688ed46c8c3531ef9 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Thu, 9 Mar 2023 08:30:39 +0100 Subject: [PATCH] Remove simulator `buf.Write` error checking --- simulator/simulator.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/simulator/simulator.go b/simulator/simulator.go index fad1ce81..e1230faa 100644 --- a/simulator/simulator.go +++ b/simulator/simulator.go @@ -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 }