Help us shape the future of Go! Take the 2026 Go Developer Survey

exitcode

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package exitcode defines process exit codes, matching gh-stack.

Index

Constants

View Source
const (
	OK               = 0
	Generic          = 1
	NotInStack       = 2
	RebaseConflict   = 3
	ProviderFailure  = 4 // the Git host (through its provider) failed
	InvalidArgs      = 5
	Ambiguous        = 6
	RebaseInProgress = 7
	Locked           = 8
	Unsupported      = 9 // the provider cannot do this, e.g. provider "none" and pull requests
)

Variables

This section is empty.

Functions

func New

func New(code int, format string, args ...any) error

New returns an error that exits with code.

func Of

func Of(err error) int

Of returns the exit code for err.

func Wrap

func Wrap(code int, err error) error

Wrap attaches code to err. A nil err stays nil.

Types

type Error

type Error struct {
	Code int
	Err  error
}

Error carries an exit code alongside an error.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL