Documentation ¶
Index ¶
- Variables
- type Env
- func (env *Env) Child(out, err io.Writer, cmd string, args ...string) error
- func (env *Env) Environ() []string
- func (env *Env) Exec(cmd string, args ...string) error
- func (env *Env) Expand(s string) string
- func (env *Env) Get(key string) (string, bool)
- func (env *Env) GetOrDefault(key, deflt string) string
- func (env *Env) Load(envs []string) error
- func (env *Env) LoadMap(envs map[string]string)
- func (env *Env) Read(fn string) error
- func (env *Env) Run(cmd string, args ...string) error
- func (env *Env) Set(key, val string)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDeclError = errors.New("env declaration error")
)
Functions ¶
This section is empty.
Types ¶
type Env ¶
Env contains environment variables for command
func (*Env) Exec ¶
Exec runs a given command, replacing the current executable. It returns only if exec is not possible.
func (*Env) Expand ¶
Expand does variable expansion for strings provided by replacing `${var}` and `$var` with values set in Env. Undefined variables replaced by an empty string.
func (*Env) GetOrDefault ¶
GetOrDefault retrieves an env. value by key, if exists. It returns default value otherwise.
Click to show internal directories.
Click to hide internal directories.