Check out example codes for "select a random number between 1 and 5 in golang". It will help you in understanding the concepts better.
Code Example 1
package main
import (
"fmt"
"math/rand"
"time" #ADDED
)
func main() {
// Seed should be set once, better spot is func init()
rand.Seed(time.Now().UTC().UnixNano()) #ADDED
fmt.Println(randInt(1, 1000))
}
func randInt(min int, max int) int {
return min + rand.Intn(max-min)
}
Learn ReactJs, React Native from akashmittal.com