Perm returns, as a slice of n ints, a pseudo-random permutation of the integers [0,n) from the default Source.
package main import ( "fmt" "math/rand" ) func main() { for _, value := range rand.Perm(3) { fmt.Println(value) } // Unordered output: 1 // 2 // 0 }