mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-20 06:54:41 +00:00
linting: apply errcheck part1
This commit is contained in:
committed by
Ethan Buchman
parent
d95ba866b8
commit
57ea4987f7
+8
-2
@@ -7,9 +7,15 @@ import (
|
||||
// doubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
|
||||
func doubleSha256(b []byte) []byte {
|
||||
hasher := sha256.New()
|
||||
hasher.Write(b)
|
||||
_, err := hasher.Write(b)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
sum := hasher.Sum(nil)
|
||||
hasher.Reset()
|
||||
hasher.Write(sum)
|
||||
_, err = hasher.Write(sum)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return hasher.Sum(nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user