Documentation
¶
Index ¶
- func MustAbs(path string) string
- func MustCreateTempDir(pattern string) string
- func MustGetWD() string
- func MustPrepareDir(dirPath string, dirMode os.FileMode)
- func MustReadFile(filePath string) []byte
- func MustUserHomeDir() string
- func MustWriteFile(filePath string, dirMode os.FileMode, fileMode os.FileMode, contents []byte) string
- func MustWriteTempFile(pattern string, contents []byte) string
- func WithMustCreateTempDir(pattern string, f func(dirPath string))
- func WithMustWriteTempFile(pattern string, contents []byte, f func(filePath string))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustCreateTempDir ¶
MustCreateTempDir is like os.MkdirTemp, but panics on error.
func MustPrepareDir ¶
MustPrepareDir deletes the given directory and its contents (if present) and recreates it.
func MustReadFile ¶
MustReadFile reads a file, panics on error.
func MustUserHomeDir ¶
func MustUserHomeDir() string
MustUserHomeDir is like os.UserHomeDir, but panics on error.
func MustWriteFile ¶
func MustWriteFile(filePath string, dirMode os.FileMode, fileMode os.FileMode, contents []byte) string
MustWriteFile creates a file with the given mode and contents, also ensuring the containing folder exists.
func MustWriteTempFile ¶
MustWriteTempFile creates a temporary file with the given contents.
func WithMustCreateTempDir ¶
WithMustCreateTempDir calls f passing it the path to a new temporary directory, which is wiped after f returns.
func WithMustWriteTempFile ¶ added in v1.2.0
WithMustWriteTempFile calls f passing it the path to a new temporary file, which is wiped after f returns.
Types ¶
This section is empty.