From 7f58d67fe38ebacbe5fb7c48239444ac762a3498 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Tue, 5 Apr 2011 20:37:41 +0200 Subject: [PATCH] Simplify reading from rand. --- uniuri.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uniuri.go b/uniuri.go index 3efada4..f4b20eb 100644 --- a/uniuri.go +++ b/uniuri.go @@ -44,7 +44,7 @@ func NewLen(length int) string { // of the provided byte slice of allowed characters (maximum 256). func NewLenChars(length int, chars []byte) string { b := make([]byte, length) - if _, err := rand.Reader.Read(b); err != nil { + if _, err := rand.Read(b); err != nil { panic("error reading from random source: " + err.String()) } alen := byte(len(chars))