Documentation
¶
Index ¶
- Variables
- func ByteSizeStr(sz uint64) string
- func CheckDirExists(path string) (bool, error)
- func CheckFileExists(path string) (bool, error)
- func CheckFileHasContent(fn string, buf []byte) bool
- func DirExists(path string) bool
- func FileExists(path string) bool
- func JSONErrDetail(input string, err error) error
- func LineAndCharacter(input string, offset int) (line int, character int, err error)
- func ReadJSON(fn string, v interface{}) error
- func ValidateDirExists(path string) error
- func ValidateEmptyDirExists(name string) error
- func ValidateFileExists(path string) error
- func WriteFileIfChanged(fn string, buf []byte) error
- func WriteJSON(fn string, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFileNotDir = errors.New("a file is located at the expected directory location") ErrDirNotFile = errors.New("a directory is located at the expected file location") ErrDirNotExist = errors.New("directory does not exist") ErrDirNotEmpty = errors.New("directory is not empty") )
Error Codes
Functions ¶
func ByteSizeStr ¶
func CheckDirExists ¶
func CheckFileExists ¶
func CheckFileHasContent ¶
CheckFileHasContent returns true if the specified file exists and has content that matches buf.
func FileExists ¶
func JSONErrDetail ¶
JSONErrDetail ammends an error returned from json.Unmarshal with line:position info.
func LineAndCharacter ¶
LineAndCharacter locates line and pos from offset into a file
func ValidateDirExists ¶
func ValidateEmptyDirExists ¶
func ValidateFileExists ¶
func WriteFileIfChanged ¶
WriteFileIfChanged writes buf into a file. Does not overwrite if the file already has the specified content. Uses 0666 permission if overwriting is neccessary.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.