Documentation
¶
Index ¶
- Variables
- func AssertFileContents(t *testing.T, fs afero.Fs, path string, content string) bool
- func AssertModePerm(t testing.TB, fs afero.Fs, path, mode string) bool
- func AssertPathExists(t *testing.T, fs afero.Fs, path string, msgAndArgs ...interface{}) bool
- func EnsureFileContent(fs afero.Fs, path string, reader io.Reader) error
- func EnsureTestFileContent(t *testing.T, fs afero.Fs, path string, content string)
- func Env() map[string]string
- func GetenvOrDefault(key, defaultValue string) string
- func HomeDir() (string, error)
- func Reset()
Constants ¶
This section is empty.
Variables ¶
View Source
var CurrentUser = user.Current
View Source
var ( // DefaultFileSystem allows to change the implementation of the default file system, for example for tests DefaultFileSystem afero.Fs = afero.NewOsFs() )
Functions ¶
func AssertFileContents ¶
func AssertPathExists ¶
func EnsureTestFileContent ¶
func GetenvOrDefault ¶
func HomeDir ¶
HomeDir returns the directory a user's own files live in.
HOME decides, which is what git, ssh and curl all do, and what makes a container, a CI job or an agent sandbox that overrides it read the files it meant to rather than the ones belonging to whoever the process happens to run as. The passwd database is consulted only when HOME says nothing, where there is nothing else to go on.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.