From edc49bbf5c89f23223f908e63aaf2785d94c896f Mon Sep 17 00:00:00 2001 From: MJ Date: Mon, 1 Oct 2018 22:43:03 +0100 Subject: [PATCH] Made rand.Read handle err that it returns --- correlationvector/spin.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/correlationvector/spin.go b/correlationvector/spin.go index 5369622..bd96e57 100755 --- a/correlationvector/spin.go +++ b/correlationvector/spin.go @@ -94,7 +94,9 @@ func SpinWithParameters(correlationVector string, parameters *SpinParameters) (* } entropy := make([]byte, int(parameters.Entropy)) - rand.Read(entropy) + if _, err := rand.Read(entropy); err != nil { + return nil, err + } // Ticks is defined as 100 nanoseconds. ticks := time.Now().UnixNano() / 100