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

gocmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package gocmd runs child processes — mostly the go toolchain — for walle and the Go GitHub Actions.

It is the one place the project's child-process environment is decided. Env holds the overrides every go invocation needs. Put such a setting here once and every build, vet, test and `go list` inherits it.

Every function takes a context so Ctrl-C (walle wires signal.NotifyContext) or a cancelled errgroup stops the child instead of orphaning it.

Index

Constants

This section is empty.

Variables

View Source
var Env = map[string]string{}

Env is the project-wide environment overlay applied to every child process. Empty by default; add entries such as "GOEXPERIMENT": "jsonv2" or "GOPRIVATE": "github.com/your-org/" here and nowhere else.

Functions

func Output

func Output(ctx context.Context, extra map[string]string, name string, args ...string) (string, error)

Output executes name with args and returns its stdout. Stderr streams to the parent so tool diagnostics stay visible.

func Quiet

func Quiet(ctx context.Context, extra map[string]string, name string, args ...string) error

Quiet executes name with args, keeping stdout out of the parent's output: on failure any stdout is folded into the error. Used where a caller renders its own report (the build action writes a step summary) and does not want console noise.

func Run

func Run(ctx context.Context, extra map[string]string, name string, args ...string) error

Run executes name with args, streaming stdout and stderr to the parent. extra is layered on top of Env; it may be nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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