Write doesn't need error checked
This commit is contained in:
parent
d033470817
commit
478a10aa41
|
@ -302,7 +302,7 @@ func shareAuthSignature(sc *SecretConnection, pubKey crypto.PubKeyEd25519, signa
|
||||||
// sha256
|
// sha256
|
||||||
func hash32(input []byte) (res *[32]byte) {
|
func hash32(input []byte) (res *[32]byte) {
|
||||||
hasher := sha256.New()
|
hasher := sha256.New()
|
||||||
_, _ = hasher.Write(input) // error ignored
|
hasher.Write(input) // nolint: errcheck
|
||||||
resSlice := hasher.Sum(nil)
|
resSlice := hasher.Sum(nil)
|
||||||
res = new([32]byte)
|
res = new([32]byte)
|
||||||
copy(res[:], resSlice)
|
copy(res[:], resSlice)
|
||||||
|
@ -312,7 +312,7 @@ func hash32(input []byte) (res *[32]byte) {
|
||||||
// We only fill in the first 20 bytes with ripemd160
|
// We only fill in the first 20 bytes with ripemd160
|
||||||
func hash24(input []byte) (res *[24]byte) {
|
func hash24(input []byte) (res *[24]byte) {
|
||||||
hasher := ripemd160.New()
|
hasher := ripemd160.New()
|
||||||
_, _ = hasher.Write(input) // error ignored
|
hasher.Write(input) // nolint: errcheck
|
||||||
resSlice := hasher.Sum(nil)
|
resSlice := hasher.Sum(nil)
|
||||||
res = new([24]byte)
|
res = new([24]byte)
|
||||||
copy(res[:], resSlice)
|
copy(res[:], resSlice)
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
// doubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
|
// doubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
|
||||||
func doubleSha256(b []byte) []byte {
|
func doubleSha256(b []byte) []byte {
|
||||||
hasher := sha256.New()
|
hasher := sha256.New()
|
||||||
_, _ = hasher.Write(b) // error ignored
|
hasher.Write(b) // nolint: errcheck
|
||||||
sum := hasher.Sum(nil)
|
sum := hasher.Sum(nil)
|
||||||
hasher.Reset()
|
hasher.Reset()
|
||||||
_, _ = hasher.Write(sum) // error ignored
|
hasher.Write(sum) // nolint: errcheck
|
||||||
return hasher.Sum(nil)
|
return hasher.Sum(nil)
|
||||||
}
|
}
|
||||||
|
|
|
@ -782,5 +782,5 @@ func writeListOfEndpoints(w http.ResponseWriter, r *http.Request, funcMap map[st
|
||||||
buf.WriteString("</body></html>")
|
buf.WriteString("</body></html>")
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
w.WriteHeader(200)
|
w.WriteHeader(200)
|
||||||
_, _ = w.Write(buf.Bytes()) // error ignored
|
w.Write(buf.Bytes()) // nolint: errcheck
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ func WriteRPCResponseHTTPError(w http.ResponseWriter, httpCode int, res types.RP
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
w.WriteHeader(httpCode)
|
w.WriteHeader(httpCode)
|
||||||
_, _ = w.Write(jsonBytes) // error ignored
|
w.Write(jsonBytes) // nolint: errcheck
|
||||||
}
|
}
|
||||||
|
|
||||||
func WriteRPCResponseHTTP(w http.ResponseWriter, res types.RPCResponse) {
|
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.Header().Set("Content-Type", "application/json")
|
||||||
w.WriteHeader(200)
|
w.WriteHeader(200)
|
||||||
_, _ = w.Write(jsonBytes) // error ignored
|
w.Write(jsonBytes) // nolint: errcheck
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -34,7 +34,7 @@ func (part *Part) Hash() []byte {
|
||||||
return part.hash
|
return part.hash
|
||||||
} else {
|
} else {
|
||||||
hasher := ripemd160.New()
|
hasher := ripemd160.New()
|
||||||
_, _ = hasher.Write(part.Bytes) // error ignored
|
hasher.Write(part.Bytes) // nolint: errcheck
|
||||||
part.hash = hasher.Sum(nil)
|
part.hash = hasher.Sum(nil)
|
||||||
return part.hash
|
return part.hash
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue