commit | 6cf2b201936e0673ace5b31d2dffa00dafb3ee58 | [log] [tgz] |
---|---|---|
author | Axel Wagner <axel.wagner.hh@gmail.com> | Fri Feb 11 08:34:49 2022 +0100 |
committer | Rob Pike <r@golang.org> | Fri Feb 18 21:58:28 2022 +0000 |
tree | df8fa2b0f007c3243b8542c29ccccd8428a71ee6 | |
parent | 3a4dbed63ffee92f89d6969d49ab1d86583840cf [diff] |
rand: make zero LockedSource useful By changing LockedSource.src from a pointer to a value its zero value becomes usable without panics. Document this behavior and add an example. Notably, it is not simply a Source protected by a sync.Mutex, as Rand also type-asserts on it for efficiency. Fixes golang/go#49342 Change-Id: Iec00766957229b7c67ede37894c9e5b9d6d8f852 Reviewed-on: https://go-review.googlesource.com/c/exp/+/385094 Reviewed-by: Rob Pike <r@golang.org> Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This subrepository holds experimental and deprecated (in the old
directory) packages.
The idea for this subrepository originated as the pkg/exp
directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get
these packages.
Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.
In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)
Caveat emptor.