3 ms·
This would be easier if there was an easy way to write the zero value, irrespective of type. https://github.com/golang/go/issues/19642 https://github.com/golan
by mikelward 4y ago
This would be easier if there was an easy way to write the zero value, irrespective of type.
https://github.com/golang/go/issues/19642 https://github.com/golang/go/issues/19642 was a proposal to have e.g.
return _, _, err
as an alternative to e.g.
return 0, "", err
- gregwebs 4y agoI would prefer this to the status quo, but it isn't a completely clean solution to the problem. If I now make a one line change at the bottom of my function to return one additional result, the only additional change in the diff should be to the type signature. But now my diff will still show adding zero values on all the rest of the return lines. It's nice that they will only be underscores- again it is certainly better than the status quo.