Skip to content

Instantly share code, notes, and snippets.

@pedrobertao
Created July 17, 2023 23:58
Show Gist options
  • Save pedrobertao/a5288a36a921ef1544dbaf58e6dfedaf to your computer and use it in GitHub Desktop.
Save pedrobertao/a5288a36a921ef1544dbaf58e6dfedaf to your computer and use it in GitHub Desktop.
// Range between two int64
func randomNum(min, max int64) int64 {
rand.Seed(time.Now().UnixNano())
num := (rand.Int63n(max-min+1) + min)
return num
}
func randomNum(min, max int64) string {
rand.Seed(time.Now().UnixNano())
num := (rand.Int63n(max-min+1) + min)
return fmt.Sprintf("%d", num)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment