3 ms·
You can return (string, error), but then what? You can't send them over a chan (string, error) or append them to a [](string, error). You can work around this b
by erik_seaberg 8y ago
You can return (string, error), but then what? You can't send them over a chan (string, error) or append them to a [](string, error). You can work around this by defining a bunch of struct types, but that's exactly what multiple return values was trying to avoid, and making a human being read and write that boilerplate is far more expensive than having the compiler supply it.
- partiallattice 8y agoSo much this. Every time I want to make a function async, I have to write my 5010th `ErrorOr` struct to send over a channel. Even if they would only add the multiple return hack to channels, that would save me a bunch of pain.