Documentation ¶
Overview ¶
Package env implements helper functions for dealing with environment variables.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse parses a list of environment variables of the form key=value into a map from keys to values. If a key appears multiple times, the last value of the key is returned.
Example ¶
vars, err := Parse([]string{ "name=alice", "pet=cat", "name=bob", // bob overwrites alice }) if err != nil { panic(err) } fmt.Println(vars["name"]) fmt.Println(vars["pet"])
Output: bob cat
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.