Concurrency examples use a waitgroup, but have to do wg .done at the end of the function. This is not a problem if there are no returns, but once there are multiple returns, the user has to have a wg .done before each return.
Due to how functions are created, I'm guessing implementing defer is not very complicated and would add a lot of value, with IO as well.
Frankly, I haven't taken the time to figure out how defer works internally in Go and if we could use that or "simulate" on our own side. I will check it out, thanks!
Concurrency examples use a waitgroup, but have to do wg .done at the end of the function. This is not a problem if there are no returns, but once there are multiple returns, the user has to have a
wg .done
before each return.Due to how functions are created, I'm guessing implementing defer is not very complicated and would add a lot of value, with IO as well.