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

process

package
v1.37.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInterruptExit

func IsInterruptExit(exitErr *exec.ExitError, exitCode int) bool

IsInterruptExit reports whether an exit status represents a Ctrl+C interrupt.

func IsInterruptExitCode

func IsInterruptExitCode(exitCode int) bool

IsInterruptExitCode reports whether exitCode is the conventional Ctrl+C exit code.

Types

type Options

type Options struct {
	Interactive bool
	// ForwardInterrupts keeps interactive Windows commands in the parent's
	// console process group so they receive Ctrl+C directly.
	ForwardInterrupts bool
	// TerminateRemainingOnWait preserves each platform's native completion cleanup
	// without running broad ownership discovery after an ordinary exit.
	TerminateRemainingOnWait bool
}

Options controls how a process scope is managed.

type Tree

type Tree struct {
	Cmd *exec.Cmd
	// contains filtered or unexported fields
}

Tree manages an exec.Cmd and its platform-specific process scope.

func New

func New(ctx context.Context, cmd *exec.Cmd, options Options) *Tree

New creates a process manager for cmd.

func (*Tree) Kill

func (t *Tree) Kill() error

Kill forcibly terminates the managed process scope.

func (*Tree) Start

func (t *Tree) Start() error

Start starts the command and completes platform process setup.

func (*Tree) Wait

func (t *Tree) Wait() error

Wait waits for the command, its cancellation watcher, and redirected I/O to finish.

Jump to

Keyboard shortcuts

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