Documentation
¶
Index ¶
- func CommonBaseSearchPaths() []string
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func FindDir(dir string) (string, bool)
- func FindDirRelBinary(dir string) (string, bool)
- func FindFile(path string) string
- func FindPath(path string, baseSearchPaths []string, filter func(os.FileInfo) bool) string
- func HumanizeJSONError(err error, data []byte) error
- func IsEmptyJSON(j json.RawMessage) bool
- func StringPtrToJSON(ptr *string) json.RawMessage
- type HumanizedJSONError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonBaseSearchPaths ¶ added in v0.0.10
func CommonBaseSearchPaths() []string
func CopyDir ¶
CopyDir will copy a directory and all contained files and directories. src must exist and dst must not exist. Permissions are preserved when possible. Symlinks are skipped.
func CopyFile ¶
CopyFile will copy a file from src path to dst path. Overwrites any existing files at dst. Permissions are copied from file at src to the new file at dst.
func FindDir ¶ added in v0.0.10
fileutils.FindDir looks for the given directory in nearby ancestors relative to the current working directory as well as the directory of the executable, falling back to `./` if not found.
func FindDirRelBinary ¶ added in v0.0.10
FindDirRelBinary looks for the given directory in nearby ancestors relative to the directory of the executable, then relative to the working directory, falling back to `./` if not found.
func FindFile ¶ added in v0.0.10
FindFile looks for the given file in nearby ancestors relative to the current working directory as well as the directory of the executable.
func HumanizeJSONError ¶
HumanizeJSONError extracts error offsets and annotates the error with useful context
func IsEmptyJSON ¶
func IsEmptyJSON(j json.RawMessage) bool
func StringPtrToJSON ¶
func StringPtrToJSON(ptr *string) json.RawMessage
Types ¶
type HumanizedJSONError ¶
func NewHumanizedJSONError ¶
func NewHumanizedJSONError(err error, data []byte, offset int64) *HumanizedJSONError
func (*HumanizedJSONError) Error ¶
func (e *HumanizedJSONError) Error() string