News for hackers. Stuff that matters.
Re:Waitgroups: What they are, how to use them and what chang... by 9rx on Saturday August 23, 2025 @01:10PM (#44997396)
> This means you can't pass variables in as function arguments.

Well, you could...

    for _, url := range urls {
        wg.Go(func(u string) func() {
            return func() {
                http.Get(u)
            }
        }(url))
    }
> You need to use this pattern instead

Why? Seems rather redundant. It is not like WaitGroup.Go exists in earlier versions.

There are no comments on this comment yet.