Comment

Comment by mykowebhn

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)
    }
parent mykowebhn 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton