Hacker News new | past | comments | ask | show | jobs | submit login
Golang 1.20rc1 released, deprecates rand.Seed() (golang.org)
1 point by pjf on Dec 8, 2022 | hide | past | favorite | 1 comment



Quote:

  - math/rand
  The math/rand package now automatically seeds the global 
  random number generator (used by top-level functions like 
  Float64 and Int) with a random value, and the top-level 
  Seed function has been deprecated. Programs that need a 
  reproducible sequence of random numbers should prefer to 
  allocate their own random source, using 
  rand.New(rand.NewSource(seed)).
  (...)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: