mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-28 08:27:42 +08:00

Using the syncronization primitive, we can avoid needing to create a separate wait group. This allows us to sidestep the issue where the wait group could be completed, but the build invocation functions had not terminated - if one of the functions was to terminate with an error, then it was possible to encounter a race condition, where the result handling code would begin executing, despite an error. The refactor to use a separate error group which more elegantly handles the concept of function returns and errors, ensures that we can't encounter this issue. Signed-off-by: Justin Chadwell <me@jedevc.com>