I think there's a bug, tho it might not make a difference to the results:
for i := 0; i < 10; i++ {
go func() {
f(i) // sees whatever value i has when f() is called, usually 10
}()
}