https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully
Errors are the way to signify failure when calling a function/method.
you can return an error using errors.New(”error message”)
here errors.New creates a new error of type error, errors is a go package
errcheck is used to find if we have any errors which are unchecked
to use errcheck install errcheck using go install [github.com/kisielk/errcheck@latest](<http://github.com/kisielk/errcheck@latest>)
sentinel errors
sentinel errors are the errors which require no further processing, they are specific errors
like io.EOF
Don’t inspect the output of error.Error()
here error.Error() return a string telling us about the error, this should generally be used for logging or displaying, if we try to compare the error string (error.Error()) and try changing the code behaviour this should be avoided