Created
October 25, 2018 10:39
-
-
Save souvikhaldar/ede021b4955dfd132f20e577ca00fff9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// getRandNum returns a random number of size four | |
func getRandNum() (string, error) { | |
nBig, e := rand.Int(rand.Reader, big.NewInt(8999)) | |
if e != nil { | |
return "", e | |
} | |
return strconv.FormatInt(nBig.Int64()+1000, 10), nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment