exitcode

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package exitcode maps errors to the documented, deterministic process exit codes (see docs/DESIGN.md §7).

Index

Constants

View Source
const (
	OK          = 0
	Error       = 1
	Usage       = 2
	NotFound    = 3
	Auth        = 4
	CheckFailed = 5
	Network     = 6
	Unsupported = 7
	Interrupted = 130
)

Exit codes. These values are part of the public interface.

Variables

This section is empty.

Functions

func Code

func Code(err error) int

Code returns the exit code for err.

func IsSilent

func IsSilent(err error) bool

IsSilent reports whether err should not be printed.

func New

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

New formats a message and attaches code.

func Silent

func Silent(code int) error

Silent is returned by commands that already reported their result (for example a failed lint) and only need to set the exit status.

func With

func With(code int, err error) error

With wraps err so that Code(err) returns code. A nil err stays nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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