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

subprocess

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package subprocess runs short, bounded probes of host executables (node, mise, package managers) with a wall-time limit and an output cap.

Index

Constants

This section is empty.

Variables

View Source
var ErrProbeTimedOut = errors.New("bounded subprocess probe timed out")

ErrProbeTimedOut is Probe's shared timeout signal; every host subprocess probe in this package (Node/mise version and install-location detection) maps it onto its own domain error rather than leaking a generic message to a readiness/runtime consumer.

Functions

func Probe

func Probe(ctx context.Context, timeout time.Duration, maxOutput int64, name string, args ...string) (data []byte, exitErr, err error)

Probe runs name with args, capped at timeout wall clock and maxOutput bytes of stdout, so a hung or unbounded-output host tool fails closed rather than wedging the CLI. exitErr carries the process's own non-zero-exit error uninterpreted -- callers assign their own meaning (a non-zero mise exit means "no candidate"; a non-zero node exit means a real error) -- while err covers every other spawn/read failure, with ErrProbeTimedOut identifying a deadline specifically.

func ProbeAt

func ProbeAt(ctx context.Context, timeout time.Duration, maxOutput int64, dir string, env []string, name string, args ...string) (data []byte, exitErr, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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