▲ | a-poor 2 days ago | |
This means you can't pass variables in as function arguments. Even the example in the official go docs doesn't handle the scope correctly:
https://pkg.go.dev/sync#example-WaitGroupYou need to use this pattern instead:
| ||
▲ | jeremyloy_wt 2 days ago | parent | next [-] | |
This isn’t necessary anymore as of Go 1.22 | ||
▲ | 9rx 2 days ago | parent | prev [-] | |
> This means you can't pass variables in as function arguments. Well, you could...
> You need to use this pattern insteadWhy? Seems rather redundant. It is not like WaitGroup.Go exists in earlier versions. |