mroth / weightedrand

:balance_scale: Fast weighted random selection for Go
MIT License
393 stars 50 forks source link

update docs regarding PickSource for go1.21 #26

Closed mroth closed 1 year ago

mroth commented 1 year ago

As per https://github.com/golang/go/commit/0b9974d3f09fe3132b4bc4aef67b839e3f84a8c8, global rand should no longer suffer from lock contention issues, removing the primary use case (imo) for this function. Once this commit is live (in go1.21 I believe) PickSource will still have value for using alternate randomness sources so should probably not be deprecated(?), but should be likely be unnecessary for high-throughput environments utilizing multiple goroutines.

At that point, the documentation should be adjusted to no longer recommend it for that particular use case.

(Notes on deprecation: https://github.com/golang/go/wiki/Deprecated)