executil

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpPATH

func DumpPATH()

DumpPATH logs the current PATH and lists all executable files found in each directory. Call this in debug dumps so that missing-binary problems are obvious from the logs alone.

Types

type Commander

type Commander interface {
	Run(ctx context.Context, name string, args ...string) ([]byte, error)
}

Commander abstracts command execution for testing.

type ExecCommander

type ExecCommander struct{}

ExecCommander executes real system commands via os/exec.

func (*ExecCommander) Run

func (e *ExecCommander) Run(ctx context.Context, name string, args ...string) ([]byte, error)

Run executes a system command and returns its combined output. On failure the error includes the sanitized, truncated raw command output. Newlines in the output are replaced with spaces to keep structured log values single-line. The resolved PATH is intentionally excluded from the returned error to avoid leaking environment layout into logs; call DumpPATH() explicitly during debug sessions when binary-not-found issues need to be diagnosed.

Jump to

Keyboard shortcuts

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