Documentation ¶
Overview ¶
Package env provides functions to test code that read environment variables or the current working directory.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeWorkingDir ¶
ChangeWorkingDir to the directory, and return a function which restores the previous working directory.
func Patch ¶
Patch changes the value of an environment variable, and returns a function which will reset the the value of that variable back to the previous state.
Example ¶
Patch an environment variable and defer to return to the previous state
defer Patch(t, "PATH", "/custom/path")()
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.