danhab99@programming.dev to Golang@programming.dev • 1 year agoI kinda wish there was a better way to do if err != nil in goexternal-linkmessage-square6 fedilinkarrow-up15file-text
arrow-up15external-linkI kinda wish there was a better way to do if err != nil in godanhab99@programming.dev to Golang@programming.dev • 1 year agomessage-square6 Commentsfedilinkfile-text
minus-squaredbx12@programming.devhexbear1·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. linkfedilink
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.