Closed Al2Klimov closed 1 week ago
I don't understand what this change is supposed to achieve! Previously, nil channels were initialised and immediately closed, and with PR nil channels are assigned to a new closed one. So, which issue is this supposed to fix?
I don't understand what this change is supposed to achieve!
Makes it more clear in the function signature, which channels are used for input and which for output.
Previously, nil channels were initialised and immediately closed, and with PR nil channels are assigned to a new closed one. So, which issue is this supposed to fix?
That probably became necessary as otherwise, once you assign a channel to upserted <-chan database.Entity
for example, you can no longer close it using that <-chan
reference. Therefore, it's assigned to a temporary variable, closed, then assigned to the final variable that no longer allows closing.
This enforces which side (caller/function) can read and especially close/write to a particular channel at compile time. That leaves less room for bugs (which had to be detected by tests otherwise).