3 ms·
Can't you simply return a nil error in case you want to return a value? Check for error and if nothing bad happened use the value.
by harpratap 6y ago
Can't you simply return a nil error in case you want to return a value? Check for error and if nothing bad happened use the value.
- leshow 6y agoThere is nothing stopping you from returning both an error and a value. Sure, you can just be diligent everywhere and not do that, we know how well that type of advice usually turns out.