From f1f30fd0c51bb6ec225aca1bdea0d24d8492afc9 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 12 May 2021 20:18:11 +0300 Subject: [PATCH] gendump: fix errcheck warning scripts/gendump/main.go:95:13: Error return value of `rand.Read` is not checked (errcheck) rand.Read(key) ^ scripts/gendump/main.go:96:13: Error return value of `rand.Read` is not checked (errcheck) rand.Read(value) ^ --- scripts/gendump/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/gendump/main.go b/scripts/gendump/main.go index 879059726..15712d532 100644 --- a/scripts/gendump/main.go +++ b/scripts/gendump/main.go @@ -92,8 +92,10 @@ func main() { txs := make([]*transaction.Transaction, txNum) for j := 0; j < txNum; j++ { nonce++ - rand.Read(key) - rand.Read(value) + _, err = rand.Read(key) + handleError("can't get random data for key", err) + _, err = rand.Read(value) + handleError("can't get random data for value", err) w := io.NewBufBinWriter() emit.AppCall(w.BinWriter, contractHash, "put", callflag.All, key, value)