gridscale / gscloud

The official command-line interface for the gridscale API
https://gridscale.io/
MIT License
16 stars 8 forks source link

Only close channel after tasks have finished #159

Closed JanLukasGithub closed 2 years ago

JanLukasGithub commented 2 years ago

The old implementation relied on the first wg.Add(1) to be called before wg.Wait(), or else the channel could be closed before the tasks even started. This probably never happened because calling go-routines is slower than starting the loop, but if anything had been put inbetween, this would've failed to load the data