diff --git a/README.md b/README.md index 20c1264..edd0c5d 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,6 @@ import ( ) func main() { - rand.Seed(time.Now().UTC().UnixNano()) // always seed random! - chooser, _ := weightedrand.NewChooser( weightedrand.NewChoice('🍒', 0), weightedrand.NewChoice('🍋', 1), diff --git a/examples/frequency/main.go b/examples/frequency/main.go index 08db4af..c4ee2ea 100644 --- a/examples/frequency/main.go +++ b/examples/frequency/main.go @@ -3,15 +3,11 @@ package main import ( "fmt" "log" - "math/rand" - "time" "github.com/mroth/weightedrand/v2" ) func main() { - rand.Seed(time.Now().UTC().UnixNano()) // always seed random! - c, err := weightedrand.NewChooser( weightedrand.NewChoice('🍒', 0), weightedrand.NewChoice('🍋', 1), diff --git a/weightedrand_test.go b/weightedrand_test.go index bcc8358..824eeb0 100644 --- a/weightedrand_test.go +++ b/weightedrand_test.go @@ -34,7 +34,7 @@ func Example() { *******************************************************************************/ func init() { - rand.Seed(time.Now().UTC().UnixNano()) + rand.Seed(time.Now().UTC().UnixNano()) // only necessary prior to go1.20 } const (