specificErr seems more reasonable.
@storozhukBM I guess both are fair style choices. I wanted to pick one, so that all my code would be consistent. specificError
seemed more natural to me: if the first word is long and written in full, might as well write "Error" in full too.
@shurcooL I always use specific names for errors, so compiler can help me to detect not checked ones, as not used variables.
That's an interesting approach. I haven't seen that before. Thanks for sharing.
I know there are tools such as errcheck
and staticcheck
that can help detect unchecked errors even if you reuse the same err
variable.
Do this:
Don't do this:
For consistency. See https://talks.golang.org/2014/names.slide#14.