lil fixes

This commit is contained in:
Zach Ramsay
2017-10-03 19:48:43 -04:00
committed by Ethan Buchman
parent 7ad8a8ab55
commit d033470817
5 changed files with 6 additions and 6 deletions

View File

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

View File

@ -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,

View File

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

View File

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

View File

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