In the go source code I read lately I found that most often err
is used when it comes to naming error variables. I personally always preferred plain e
(mainly because it is 66.6% shorter).
To increase my code compatibility I decided to get some data about that. Two greps (powered by silversearcher) on the code in the stdlib later I had some numbers I could work with:
/usr/local/go/src$ e=$(ag " e := " | wc -l); echo $e
334
/usr/local/go/src$ err=$(ag " err := " | wc -l); echo $err
4128