Browse Source

Write doesn't need error checked

pull/703/head
Zach Ramsay 7 years ago
committed by Ethan Buchman
parent
commit
478a10aa41
5 changed files with 8 additions and 8 deletions
  1. +2
    -2
      p2p/secret_connection.go
  2. +2
    -2
      p2p/util.go
  3. +1
    -1
      rpc/lib/server/handlers.go
  4. +2
    -2
      rpc/lib/server/http_server.go
  5. +1
    -1
      types/part_set.go

+ 2
- 2
p2p/secret_connection.go 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) // error ignored
hasher.Write(input) // nolint: errcheck
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) // error ignored
hasher.Write(input) // nolint: errcheck
resSlice := hasher.Sum(nil)
res = new([24]byte)
copy(res[:], resSlice)


+ 2
- 2
p2p/util.go View File

@ -7,9 +7,9 @@ import (
// doubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
func doubleSha256(b []byte) []byte {
hasher := sha256.New()
_, _ = hasher.Write(b) // error ignored
hasher.Write(b) // nolint: errcheck
sum := hasher.Sum(nil)
hasher.Reset()
_, _ = hasher.Write(sum) // error ignored
hasher.Write(sum) // nolint: errcheck
return hasher.Sum(nil)
}

+ 1
- 1
rpc/lib/server/handlers.go View File

@ -782,5 +782,5 @@ func writeListOfEndpoints(w http.ResponseWriter, r *http.Request, funcMap map[st
buf.WriteString("</body></html>")
w.Header().Set("Content-Type", "text/html")
w.WriteHeader(200)
_, _ = w.Write(buf.Bytes()) // error ignored
w.Write(buf.Bytes()) // nolint: errcheck
}

+ 2
- 2
rpc/lib/server/http_server.go View File

@ -56,7 +56,7 @@ func WriteRPCResponseHTTPError(w http.ResponseWriter, httpCode int, res types.RP
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(httpCode)
_, _ = w.Write(jsonBytes) // error ignored
w.Write(jsonBytes) // nolint: errcheck
}
func WriteRPCResponseHTTP(w http.ResponseWriter, res types.RPCResponse) {
@ -66,7 +66,7 @@ func WriteRPCResponseHTTP(w http.ResponseWriter, res types.RPCResponse) {
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(200)
_, _ = w.Write(jsonBytes) // error ignored
w.Write(jsonBytes) // nolint: errcheck
}
//-----------------------------------------------------------------------------


+ 1
- 1
types/part_set.go View File

@ -34,7 +34,7 @@ func (part *Part) Hash() []byte {
return part.hash
} else {
hasher := ripemd160.New()
_, _ = hasher.Write(part.Bytes) // error ignored
hasher.Write(part.Bytes) // nolint: errcheck
part.hash = hasher.Sum(nil)
return part.hash
}


Loading…
Cancel
Save