The traditional error handling idiom in Go is roughly akin to
if err != nil {
return err
}
which applied recursively up the call stack results in error reports without context or debugging information.
The errors package allows programmers to use errors as Exception in Java in their code.