golang 的 rabbitmq 消费项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

17 line
313 B

  1. package utils
  2. import (
  3. "math/rand"
  4. "time"
  5. )
  6. func RandFloats(min, max float64) float64 {
  7. rand.Seed(time.Now().UnixNano())
  8. return min + rand.Float64()*(max-min)
  9. }
  10. func RandInt(max int) int {
  11. rand.Seed(time.Now().UnixNano()) // seed后随机数可变
  12. return rand.Intn(max) // 0-100的随机数
  13. }