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

exitcode

package
v0.2026225.1508 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package exitcode (github.com/opencharly/spec/exitcode, #55 import-purity) holds the process exit-code contract a command plugin's Invoke(OpRun) returns to the host and the check-command 0/1/2/3 convention single-sourced here so both the host (main()'s exit mapping + `charly box feature run`) and the check-engine candy reference ONE contract. It is a fabric slice of the spec contract module — pure Go constants + a tiny error wrapper, no heavy deps (#55 Rule 2) — relocated from the github.com/opencharly/sdk root package. charly core imports this slice INSTEAD of the sdk root; the sdk root keeps a thin re-export during cutover then is deleted.

Index

Constants

View Source
const (
	CheckFailExitCode    = 2
	CheckSkippedExitCode = 3
)

The check-command exit-code convention (goss/pytest 0/1/2/3), single-sourced here so both the HOST (main()'s exit mapping + `charly box feature run`) and candy/plugin-check reference ONE contract:

0  all checks passed
1  infra / usage error — no pass/fail verdict was produced (the host default)
2  the check RAN and one or more checks FAILED
3  the bed was SKIPPED (a required host prerequisite — e.g. a GPU — is absent)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitCodeError

type ExitCodeError struct {
	Code int
	Err  error
}

ExitCodeError carries a specific PROCESS exit code from a command plugin's Invoke(OpRun) back to the host, which maps it to os.Exit(Code). A compiled-in command candy returns its error verbatim through the in-proc dispatch, but the host cannot classify the plugin's OWN error TYPES across the module boundary — so a command that must set a NON-1 exit code (the check 0/1/2/3 convention) wraps its failure in *ExitCodeError, which the host detects with errors.As and honors as the exit status. Code 0 falls back to the host's default error handling (no special code).

func (*ExitCodeError) Error

func (e *ExitCodeError) Error() string

func (*ExitCodeError) Unwrap

func (e *ExitCodeError) Unwrap() error

Jump to

Keyboard shortcuts

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