Documentation
¶
Overview ¶
Package executil provides helpers for spawning subprocesses.
Index ¶
Constants ¶
const DefaultBdTimeout = 5 * time.Minute
DefaultBdTimeout is the default timeout for bd subprocess invocations. bd operations on anvils with remote Dolt (e.g. via kubectl port-forward) and GitHub auto-sync can routinely take 20-30 seconds per write, so the timeout must be generous enough to accommodate that latency.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSON ¶ added in v0.13.0
DecodeJSON decodes one JSON value from subprocess output that may contain leading or trailing non-JSON noise (log lines, diagnostics, etc.).
It first tries to decode the whole output. On failure it walks top-level '{' positions (then top-level '[' positions) using bytes.IndexByte in a streaming loop, returning the first candidate that succeeds. Only positions at start-of-input or preceded by whitespace are considered, so nested objects inside arrays are not treated as standalone top-level values. The scan is bounded to maxJSONScanBytes bytes and maxJSONCandidates attempts.
func HideWindow ¶
HideWindow configures cmd to not create a visible console window. On Windows this sets CREATE_NO_WINDOW. On other platforms it is a no-op.
Types ¶
This section is empty.