code

package
v1.3.163 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package code defines structured exit code constants for ktn-linter. Each code has a semantic name and belongs to a category range.

Index

Constants

View Source
const (
	// Success indicates the operation completed without issues.
	Success int = 0
	// IssuesFound indicates lint issues were detected.
	IssuesFound int = 1
)

Lint Results (0-9).

View Source
const (
	// ConfigNotFound indicates the config file was not found.
	ConfigNotFound int = 10
	// ConfigInvalid indicates the config file is malformed.
	ConfigInvalid int = 11
)

Configuration Errors (10-19).

View Source
const (
	// NoGoFiles indicates no Go files were found to analyze.
	NoGoFiles int = 20
	// InputNotFound indicates the specified input path does not exist.
	InputNotFound int = 21
	// PackageLoadFailed indicates Go packages could not be loaded.
	PackageLoadFailed int = 22
)

Input Errors (20-29).

View Source
const (
	// AnalysisFailed indicates the analysis pipeline failed.
	AnalysisFailed int = 30
	// AnalysisTimeout indicates the analysis timed out.
	AnalysisTimeout int = 31
	// FormatterFailed indicates output formatting failed.
	FormatterFailed int = 32
)

Analysis Errors (30-39).

View Source
const (
	// CommandInitFailed indicates command initialization failed.
	CommandInitFailed int = 40
	// CommandExecFailed indicates command execution failed.
	CommandExecFailed int = 41
)

Command Errors (40-49).

View Source
const (
	// OutputWriteFailed indicates output could not be written.
	OutputWriteFailed int = 50
	// FilesystemError indicates a filesystem operation failed (chdir, mkdir, etc.).
	FilesystemError int = 51
)

I/O Errors (50-59).

View Source
const (
	// UpgradeFailed indicates the self-upgrade process failed.
	UpgradeFailed int = 60
	// ServerStartFailed indicates the MCP server failed to start.
	ServerStartFailed int = 61
)

Network/External Errors (60-69).

View Source
const (
	// TTYRequired indicates an interactive terminal is required.
	TTYRequired int = 70
	// TUIFailed indicates the TUI crashed or failed.
	TUIFailed int = 71
)

TUI/Interactive Errors (70-79).

View Source
const (
	// GracefulShutdown indicates the process received a termination signal.
	GracefulShutdown int = 80
)

Signal/Shutdown (80-89).

Variables

This section is empty.

Functions

func All

func All() (codes []int)

All returns all registered exit codes in ascending order.

Returns:

  • codes: sorted slice of all registered exit code values

func Name

func Name(c int) (label string)

Name returns the human-readable name for an exit code.

Params:

  • c: exit code value

Returns:

  • label: the name string for known codes, or "Unknown(N)" for unregistered codes

Types

This section is empty.

Jump to

Keyboard shortcuts

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