2 ms·
I mentioned RAII because the text around "with" mentions its use with RAII. Go does not have exceptions (panic is not meant as "normal" flow control), and ther
by arghwhat 9y ago
I mentioned RAII because the text around "with" mentions its use with RAII.
Go does not have exceptions (panic is not meant as "normal" flow control), and therefore has no use for a "with" construct. "defer" is used for a somewhat similar purpose. Go does not have destructors, and therefore has no possible implementation of RAII.
However, none of this applies to goroutines. A goroutine only gives errors if the author decides that such is necessary. If so, it will likely be through an error channel. There is no unexpected code paths through such readout, rendering "with" and RAII useless.
So again, for a post that was very focused on complaining directly about the "go" keyword, I was expecting something applicable to Go.