Or commonly, tho perhaps confusingly:
for i := 0; i < 10 i++ {
i := i // new variable i for every iteration
go func() { f(i) }()
}