Documentation
¶
Overview ¶
Package env contains data structures and methods to assist with managing environment variables.
Index ¶
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
}
Env represents a map of environment variables. By default, the keys are case-insensitive on Windows and case-sensitive on other platforms. If they are case-insensitive, the original casing is lost.
func New ¶
New return a new `Env`. By default, it is case-insensitive on Windows and case-sensitive on other platforms. See `Options` for available options.
type Options ¶
type Options func(*Env)
Options are functional options for creating a new Env.
func CaseSensitive ¶
CaseSensitive is an option that overrides previous case-sensitivity whether set by default or as an `Option`.
func FromMap ¶
FromMap is an option that sets the Env to have the key-values pairs from the `source` map. The key-value pair will be inserted with the case sensitivity of the Env, which by default is case-insensitive on Windows and case-sensitive on other platforms. Note that random map iteration will cause the result to be non-deterministic if there are multiple keys in `source`, which are equivalent under case insensitivity, that have different corresponding values.