Documentation
¶
Index ¶
- type Env
- func (e *Env) Changed() []VariableChange
- func (e *Env) Environ() (vars []string)
- func (e *Env) Get(name string) string
- func (e *Env) IsInPath(path string) bool
- func (e *Env) PrependToPath(path string)
- func (e *Env) RemoveFromPath(substring string)
- func (e *Env) Set(name string, value string)
- func (e *Env) Unset(name string)
- type VariableChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
An Env provides a simple interface to manipulate environment variables
func NewFromOS ¶
func NewFromOS() (e *Env)
NewFromOS returns a new Env with variables from os.Environ()
func (*Env) Changed ¶
func (e *Env) Changed() []VariableChange
Changed returns all changes made on the variables
func (*Env) IsInPath ¶ added in v0.8.0
IsInPath returns true if one path of $PATH is exactly equal to the path provided
func (*Env) PrependToPath ¶
PrependToPath inserts a new path at the beginning of the PATH variable
func (*Env) RemoveFromPath ¶
RemoveFromPath removes all path entries matching a substring
type VariableChange ¶
A VariableChange represents the change made on a variable
Click to show internal directories.
Click to hide internal directories.