From 7ee294b329febf3138fa4aa09b7cecacb247dbea Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 15 Apr 2021 00:20:42 +0200 Subject: [PATCH] add noop error check --- types/address/hash.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/address/hash.go b/types/address/hash.go index 912b831fc2da..8d9c5b39e11b 100644 --- a/types/address/hash.go +++ b/types/address/hash.go @@ -20,12 +20,13 @@ type Addressable interface { // Hash creates a new address from address type and key func Hash(typ string, key []byte) []byte { hasher := sha256.New() - hasher.Write(conv.UnsafeStrToBytes(typ)) + _, err := hasher.Write(conv.UnsafeStrToBytes(typ)) + // the error always nil, it's here only to satisfy the io.Writer interface + errors.AssertNil(err) th := hasher.Sum(nil) hasher.Reset() - _, err := hasher.Write(th) - // the error always nil, it's here only to satisfy the io.Writer interface + _, err = hasher.Write(th) errors.AssertNil(err) _, err = hasher.Write(key) errors.AssertNil(err)