README ¶ go-err-code An opinionated module for bubbling up and consuming exit codes alongside errors. Useful for packages that are used by CLIs alike to return helpful codes to the caller without having to parse error strings. install go get github.com/frantjc/go-error-code Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func ExitCode(err error) int type Error func New(err error, opts ...ErrorOpt) *Error func (e *Error) ExitCode() int func (e *Error) Unwrap() error type ErrorOpt func WithExitCode(exitCode int) ErrorOpt type ExitCoder Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ExitCode ¶ func ExitCode(err error) int Types ¶ type Error ¶ type Error struct { // contains filtered or unexported fields } func New ¶ func New(err error, opts ...ErrorOpt) *Error func (*Error) ExitCode ¶ func (e *Error) ExitCode() int func (*Error) Unwrap ¶ func (e *Error) Unwrap() error type ErrorOpt ¶ type ErrorOpt func(*Error) func WithExitCode ¶ func WithExitCode(exitCode int) ErrorOpt type ExitCoder ¶ type ExitCoder interface { ExitCode() int } Source Files ¶ View all Source files code.goerror.go Click to show internal directories. Click to hide internal directories.