mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 03:53:42 +00:00
all: show error if platform has no rng
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user