diff --git a/p2p/addrbook.go b/p2p/addrbook.go index 4b88fdf6..8f924d12 100644 --- a/p2p/addrbook.go +++ b/p2p/addrbook.go @@ -371,7 +371,7 @@ func (a *AddrBook) loadFromFile(filePath string) bool { if err != nil { cmn.PanicCrisis(cmn.Fmt("Error opening file %s: %v", filePath, err)) } - defer r.Close() // nolint (errcheck) + defer r.Close() // nolint: errcheck aJSON := &addrBookJSON{} dec := json.NewDecoder(r) err = dec.Decode(aJSON) diff --git a/p2p/connection.go b/p2p/connection.go index 29002942..ad73b68e 100644 --- a/p2p/connection.go +++ b/p2p/connection.go @@ -184,7 +184,7 @@ func (c *MConnection) OnStop() { if c.quit != nil { close(c.quit) } - c.conn.Close() // nolint (errcheck) + c.conn.Close() // nolint: errcheck // We can't close pong safely here because // recvRoutine may write to it after we've stopped. // Though it doesn't need to get closed at all, diff --git a/p2p/listener.go b/p2p/listener.go index 5b5f60a4..32a608d6 100644 --- a/p2p/listener.go +++ b/p2p/listener.go @@ -117,7 +117,7 @@ func (l *DefaultListener) OnStart() error { func (l *DefaultListener) OnStop() { l.BaseService.OnStop() - l.listener.Close() // nolint (errcheck) + l.listener.Close() // nolint: errcheck } // Accept connections and pass on the channel diff --git a/p2p/secret_connection.go b/p2p/secret_connection.go index f034b4c0..02d7f622 100644 --- a/p2p/secret_connection.go +++ b/p2p/secret_connection.go @@ -302,7 +302,7 @@ func shareAuthSignature(sc *SecretConnection, pubKey crypto.PubKeyEd25519, signa // sha256 func hash32(input []byte) (res *[32]byte) { hasher := sha256.New() - _, _ = hasher.Write(input) // ignoring error + _, _ = hasher.Write(input) // error ignored resSlice := hasher.Sum(nil) res = new([32]byte) copy(res[:], resSlice) @@ -312,7 +312,7 @@ func hash32(input []byte) (res *[32]byte) { // We only fill in the first 20 bytes with ripemd160 func hash24(input []byte) (res *[24]byte) { hasher := ripemd160.New() - _, _ = hasher.Write(input) // ignoring error + _, _ = hasher.Write(input) // error ignored resSlice := hasher.Sum(nil) res = new([24]byte) copy(res[:], resSlice) diff --git a/rpc/lib/client/ws_client_test.go b/rpc/lib/client/ws_client_test.go index 5ee509b8..8552a4ee 100644 --- a/rpc/lib/client/ws_client_test.go +++ b/rpc/lib/client/ws_client_test.go @@ -105,7 +105,7 @@ func TestWSClientReconnectsAfterWriteFailure(t *testing.T) { // hacky way to abort the connection before write if err := c.conn.Close(); err != nil { - panic(err) + t.Error(err) } // results in WS write error, the client should resend on reconnect