Today i learned on go-errcheck. This small utility is quite handy to check unchecked error handling in our code. I found out this tool when refreshing my Go lesson on Learning Go With Tests during error handling chapter.
go-errcheck need go 1.12 or newer.
Installation on go <= 1.17
go get -u github.com/kisielk/errcheck
Installation on go >= 1.17
go install github.com/kisielk/errcheck@lates
If you are using asdf as package manager like me, don’t forget to add your $GOROOT/bin into the path
Check current directory
Check all packages beneath current directory
Check package of interest
If there is unhandled error, it will reporting back to you