Created
July 17, 2023 23:58
-
-
Save pedrobertao/a5288a36a921ef1544dbaf58e6dfedaf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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