procx

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package procx starts the project's commands (restore, prepare, guards, command steps, token commands, bisect hooks) so that a time limit or an interrupt stops all of what they started, not only the command itself: a command runs in a process group of its own, and the whole group is killed when its context ends. Without that, a child that keeps the command's output open (the server `make restart` starts, a shell's job) keeps the wait going past any time limit, and outlives it.

Index

Constants

This section is empty.

Variables

View Source
var WaitDelay = 5 * time.Second

WaitDelay is how long a command's output is still read after it ended or its context did: a child it left behind may hold the output open.

Functions

func Command

func Command(ctx context.Context, name string, arg ...string) *exec.Cmd

Command is exec.CommandContext for a command of the project, in a process group of its own that is killed when ctx ends. Run it with Run or Output.

func KillAll

func KillAll()

KillAll kills every command still running, with what it started: for a process that is about to end at once (a second Ctrl-C), whose commands would otherwise run on, outside the terminal's reach.

func Output

func Output(cmd *exec.Cmd) ([]byte, error)

Output is Run that returns the standard output, as exec.Cmd.Output does.

func Run

func Run(cmd *exec.Cmd) error

Run runs a command made by Command. A command that ended well but left a process holding its output open (a server started in the background) ended well: its output after that is not read.

Types

This section is empty.

Jump to

Keyboard shortcuts

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