I tried to translate the following Python code to Go
import random
list = [i for i in range(1, 25)]
random.shuffle(list)
print(list)
but found my Go version lengthy and awkward because there is no shuffle function and I had to implement interfaces and convert types.
What would be an idiomatic Go version of my code?
As your list is just the integers from 1 to 25, you can use Perm :
Note that using a permutation given by
rand.Permis an effective way to shuffle any array.