all: show error if platform has no rng

This commit is contained in:
Kenneth Bell
2021-12-28 18:58:24 +00:00
committed by Ron Evans
parent 5c3ad004ab
commit 0099d47002
+4
View File
@@ -15,5 +15,9 @@ var Reader io.Reader
// Read is a helper function that calls Reader.Read using io.ReadFull.
// On return, n == len(b) if and only if err == nil.
func Read(b []byte) (n int, err error) {
if Reader == nil {
panic("no rng")
}
return io.ReadFull(Reader, b)
}