This is a very common newbie mistake. Fix by passing in i.
for i := 0; i < 10; i++ {
go func(i int) {
f(i) // sees whatever value i has when f() is called, usually 10
}(i)
}