From 1c2c68fbfdadae43410f40aaaefbe0dbff0fedb9 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Thu, 28 Jul 2022 14:29:35 -0400 Subject: [PATCH] fix: test and lint --- waku/v2/rpc/admin_test.go | 4 ++-- waku/v2/rpc/codec.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/waku/v2/rpc/admin_test.go b/waku/v2/rpc/admin_test.go index b01b62f9..50f911a4 100644 --- a/waku/v2/rpc/admin_test.go +++ b/waku/v2/rpc/admin_test.go @@ -46,7 +46,7 @@ func TestV1Peers(t *testing.T) { err = a.GetV1Peers(request, &GetPeersArgs{}, &reply) require.NoError(t, err) - require.Len(t, reply.Peers, 0) + require.Len(t, reply, 0) var reply2 SuccessReply @@ -66,5 +66,5 @@ func TestV1Peers(t *testing.T) { err = a.GetV1Peers(request, &GetPeersArgs{}, &reply) require.NoError(t, err) - require.Len(t, reply.Peers, 2) + require.Len(t, reply, 2) } diff --git a/waku/v2/rpc/codec.go b/waku/v2/rpc/codec.go index 2e9e9477..ebcea8ba 100644 --- a/waku/v2/rpc/codec.go +++ b/waku/v2/rpc/codec.go @@ -187,7 +187,7 @@ func (c *CodecRequest) writeServerResponse(w http.ResponseWriter, status int, re if err == nil { w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(status) - w.Write(b) + _, _ = w.Write(b) } else { // Not sure in which case will this happen. But seems harmless. rpc.WriteError(w, 400, err.Error())