Documentation ¶
Overview ¶
Package osutil offers a utility for manipulating a set of environment variables.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environ ¶
type Environ []string
Environ is a slice of strings representing the environment, in the form "key=value".
Example ¶
package main import ( "os" "os/exec" "github.com/shurcooL/go/osutil" ) func main() { cmd := exec.Command("example") env := osutil.Environ(os.Environ()) env.Set("USER", "gopher") env.Set("HOME", "/usr/gopher") env.Unset("TMPDIR") cmd.Env = env }
Output:
Click to show internal directories.
Click to hide internal directories.