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

toolenv

package
v1.37.1-stratum.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package toolenv is how host tools are found and run when Stratum runs them as root: iptables and tc load code from XTABLES_LIBDIR and TC_LIB_DIR, and a shim of any tool can sit first on the caller's PATH, so neither the caller's environment nor its PATH is used.

Index

Constants

View Source
const Path = "/usr/sbin:/usr/bin:/sbin:/bin"

Path is where those tools are looked for and what they see as PATH.

Variables

This section is empty.

Functions

func Cmd

func Cmd(path, name string, args ...string) *exec.Cmd

Cmd is exec.Command with name looked up in path, not on the caller's PATH, and Env as the environment. A name with a slash is used as given. The command is built from the resolved path: exec looks a bare name up on the caller's PATH as soon as it is given one. A name not in path leaves a path with a slash, so exec does not look it up elsewhere, and exec.ErrNotFound, which is also what the command then fails with.

func Env

func Env() []string

Env is the whole environment of a host tool. LC_ALL=C because callers match the English text tools print.

func Look

func Look(path, name string) (string, error)

Look is name's path in the dirs of path, as Cmd uses it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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