go get github.com/030/go-utils
and add the following to the go file:
import ( "github.com/pkg/errors" "github.com/030/go-utils" )
utils.CheckErrorPrintStackTraceAndExit(errors.WithStack(err))