Skip to content

v0.25.0

tagged this 15 Aug 11:45
* Add Shell method for running commands via the system shell

Adds ExecCommand(name, args...), which runs a command directly with
no parsing, holding the shared stdin/stdout/stderr/env/context/
error-handling logic.

Exec is now a thin wrapper that splits cmdLine with shell.Fields and
delegates to ExecCommand. A shell.Fields parse error is now surfaced
immediately via p.WithError, rather than only becoming visible once
the pipe is read; this is covered by
TestExec_SetsErrorImmediatelyOnInvalidCommandLineSyntax.

Shell runs cmdLine via the operating system's native shell (sh -c on
Unix-like systems, cmd /C on Windows, chosen via runtime.GOOS), by
calling ExecCommand directly with cmdLine as a single, completely
unmodified argument. This fixes the WithEnv/variable-expansion bug
described in #239, since the shell alone is responsible for parsing
and expansion, with no local re-interpretation of the command line.

Tested on both Linux and Windows.

* tweaks

* bump to go1.26.6 for GO-2026-6218, GO-2026-6090, GO-2026-5972, GO-2026-5856, GO-2026-5026

---------

Co-authored-by: Dhanalakshmi-D04 <dhanalakshmidgowda04@gmail.com>
Co-authored-by: John Arundel <john@bitfieldconsulting.com>
Assets 2
Loading