From 2fec0c78912e3ad042efa54934cdb078fc65ec46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 8 May 2023 18:39:58 +0200 Subject: [PATCH] make lint happy --- handler.go | 6 +++--- rpc_test.go | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/handler.go b/handler.go index ecb0d5e..8b2a709 100644 --- a/handler.go +++ b/handler.go @@ -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)) @@ -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 { diff --git a/rpc_test.go b/rpc_test.go index 1119dda..73bd9c1 100644 --- a/rpc_test.go +++ b/rpc_test.go @@ -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)