mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-26 19:42:23 +00:00
pkg/(crypto|vm): fix GolangCI errcheck warnings
Like: Error return value of alg.Write is not checked (from errcheck) Actually even though the hash.Hash implements an io.Writer interface (that return meaningful things on .Write()) it has this comment in its documentation: // Write (via the embedded io.Writer interface) adds more data to the running hash. // It never returns an error. so it should be OK to ignore return results here.
This commit is contained in:
parent
a976c4d04f
commit
06f9e1d123
2 changed files with 3 additions and 3 deletions
|
@ -26,7 +26,7 @@ func ExampleSignECDSA() {
|
|||
|
||||
// Hash a message.
|
||||
alg := sha512.New()
|
||||
alg.Write([]byte("I am a potato."))
|
||||
_, _ = alg.Write([]byte("I am a potato."))
|
||||
hash := alg.Sum(nil)
|
||||
|
||||
// Sign the message. You don't need a PRNG for this.
|
||||
|
@ -59,7 +59,7 @@ func ExampleSignDSA() {
|
|||
|
||||
// Hash a message.
|
||||
alg := sha1.New()
|
||||
alg.Write([]byte("I am a potato."))
|
||||
_, _ = alg.Write([]byte("I am a potato."))
|
||||
hash := alg.Sum(nil)
|
||||
|
||||
// Sign the message. You don't need a PRNG for this.
|
||||
|
|
|
@ -21,7 +21,7 @@ func SHA1(op stack.Instruction, ctx *stack.Context, istack *stack.Invocation, rs
|
|||
}
|
||||
|
||||
alg := sha1.New()
|
||||
alg.Write(ba.Value())
|
||||
_, _ = alg.Write(ba.Value())
|
||||
hash := alg.Sum(nil)
|
||||
res := stack.NewByteArray(hash)
|
||||
|
||||
|
|
Loading…
Reference in a new issue