4 ms·
A better solution would be a struct as return value of channel which contains both value and error as fields. So just casually one would handle the case: if r
by nilsocket 8y ago
A better solution would be a struct as return value of channel which contains both value and error as fields.
So just casually one would handle the case:
if ret.err != nil{
//Handle error.
}