I want to get multiple random elements from list in same time, but need to be real random not every time same elements.
Second problem is : i want to get uniq element from the list, example if i get 08, this code need to be removed from list and get net random exclude 08 string.
this is my actual code :
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
// Won't work on the Playground since the time is frozen.
rand.Seed(time.Now().Unix())
reasons := []string{
"01","02","03","04", "05", "06", "07", "08", "09", "10",
}
n := rand.Int() % len(reasons)
n1 := rand.Int() % len(reasons)
n2 := rand.Int() % len(reasons)
fmt.Println("", reasons[n])
fmt.Println("", reasons[n1])
fmt.Println("", reasons[n2])
}
my output is this :
07
02
06
every time return me same output, i want to be random and unique