Documentation
¶
Index ¶
- type Env
- func (e *Env) Environ() []string
- func (e *Env) Get(name string) string
- func (e *Env) Has(name string) bool
- func (e *Env) Mutations() []VariableMutation
- 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 VariableMutation
- type Variables
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 (*Env) Mutations ¶ added in v0.10.0
func (e *Env) Mutations() []VariableMutation
Mutations returns a list of variable mutations (previous and current value)
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 VariableMutation ¶ added in v0.10.0
type VariableMutation struct {
Name string
Previous *variable
Current *variable
}
VariableMutation represents the change made on a variable
func (VariableMutation) DiffString ¶ added in v0.10.0
func (m VariableMutation) DiffString() string
DiffString returns a representation of the mutation as a diff
Click to show internal directories.
Click to hide internal directories.