m-lab / go

General purpose libraries / APIs for use in mlab code.
Apache License 2.0
5 stars 6 forks source link

Use the default source for randomization #177

Closed cristinaleonr closed 1 year ago

cristinaleonr commented 1 year ago

This PR changes the mathx package to use the default Source from math/rand, which unlike NewSource, is safe for concurrent use.

Since go 1.20, the math/rand package automatically seeds the default Source with a random value.


This change is Reviewable

cristinaleonr commented 11 months ago

Fixes https://github.com/m-lab/locate/issues/168