@[email protected] to [email protected]English • 1 year agoI kinda wish there was a better way to do if err != nil in gogithub.comexternal-linkmessage-square9fedilinkarrow-up19arrow-down16file-text
arrow-up13arrow-down1external-linkI kinda wish there was a better way to do if err != nil in gogithub.com@[email protected] to [email protected]English • 1 year agomessage-square9fedilinkfile-text
minus-squaredbx12linkfedilink-4•1 year agoI too consider that if err != nil a bit complicated to type. Most times, I wrap it away in a function like your Check0. I know that the major “framework” for command line applications (cobra) has a similar logic with its checkError function.
I too consider that
if err != nil
a bit complicated to type. Most times, I wrap it away in a function like yourCheck0
. I know that the major “framework” for command line applications (cobra) has a similar logic with itscheckError
function.