Skip to content

Commit

Permalink
make lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed May 8, 2023
1 parent a9d5e9e commit 2fec0c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (s *handler) handleReader(ctx context.Context, r io.Reader, w io.Writer, rp
return
}

w.Write([]byte("["))
_, _ = w.Write([]byte("[")) // todo consider handling this error
for idx, req := range reqs {
if req.ID, err = normalizeID(req.ID); err != nil {
rpcError(wf, &req, rpcParseError, xerrors.Errorf("failed to parse ID: %w", err))
Expand All @@ -249,10 +249,10 @@ func (s *handler) handleReader(ctx context.Context, r io.Reader, w io.Writer, rp
s.handle(ctx, req, wf, rpcError, func(bool) {}, nil)

if idx != len(reqs)-1 {
w.Write([]byte(","))
_, _ = w.Write([]byte(",")) // todo consider handling this error
}
}
w.Write([]byte("]"))
_, _ = w.Write([]byte("]")) // todo consider handling this error
} else {
var req request
if err := json.NewDecoder(bufferedRequest).Decode(&req); err != nil {
Expand Down
6 changes: 4 additions & 2 deletions rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,10 @@ func TestChanClientReceiveAll(t *testing.T) {
}

func TestControlChanDeadlock(t *testing.T) {
logging.SetLogLevel("rpc", "error")
defer logging.SetLogLevel("rpc", "debug")
_ = logging.SetLogLevel("rpc", "error")
defer func() {
_ = logging.SetLogLevel("rpc", "debug")
}()

for r := 0; r < 20; r++ {
testControlChanDeadlock(t)
Expand Down

0 comments on commit 2fec0c7

Please sign in to comment.