From: Ian Lance Taylor Date: Tue, 26 Nov 2024 23:37:14 +0000 (-0800) Subject: doc/next: document that crypto/rand.Read never fails X-Git-Tag: go1.24rc1~64 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2a93bd0d79484281b9706e2d66a0b21b42da66de;p=gostls13.git doc/next: document that crypto/rand.Read never fails For #66821 Change-Id: Id9b640a57b9d4d1f9114769f607480b14961e7b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/632036 Reviewed-by: Russ Cox Reviewed-by: Dmitri Shuralyov Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI --- diff --git a/doc/next/6-stdlib/99-minor/crypto/rand/66821.md b/doc/next/6-stdlib/99-minor/crypto/rand/66821.md new file mode 100644 index 0000000000..766e81e13a --- /dev/null +++ b/doc/next/6-stdlib/99-minor/crypto/rand/66821.md @@ -0,0 +1,7 @@ +The [Read] function, and the `Read` method of [Reader], are now +defined to never fail. +They will always return `nil` as the `error` result. +If something somehow goes wrong while reading random numbers, +the program will irrecoverably crash. +This change was made because all supported systems now provide +sources of random bytes that never fail.