fix: test and lint

This commit is contained in:
Richard Ramos 2022-07-28 14:29:35 -04:00
parent 2bfdcb6fd1
commit 1c2c68fbfd
No known key found for this signature in database
GPG Key ID: BD36D48BC9FFC88C
2 changed files with 3 additions and 3 deletions

View File

@ -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)
}

View File

@ -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())