mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-20 13:01:28 -04:00
The "go fix" modernizer for using wg.Go instead of explicit wg.Add/wg.Done only works when the goroutine function has no arguments, so it didn't match here where this code was still using an old trick to ensure that each goroutine would capture a different value of "i". But that old trick isn't needed anymore because modern Go already ensures that each iteration of the loop has an independent "i", so I made a small change to remove the argument and just let the closure capture "i" from the outer loop, and then "go fix" was able to complete the rewrite to use wg.Go here. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>