Documentation
¶
Overview ¶
Package fs provides filesystem utility functions.
Index ¶
- func Copy(src, dst string) error
- func CreateDirIfNotExist(path string) error
- func Exists(path string) bool
- func GetExecutablePath() string
- func IsEmpty(path string) (bool, error)
- func ReadJSON(path string, data interface{}) error
- func ReadLines(path string) ([]string, error)
- func ReadYAML(path string, data interface{}) error
- func WriteJSON(path string, data interface{}) error
- func WriteString(path string, content string) error
- func WriteYAML(path string, data interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfNotExist ¶
CreateDirIfNotExist creates a directory and all parent directories if they don't exist.
func GetExecutablePath ¶
func GetExecutablePath() string
GetExecutablePath returns the directory path of the current executable.
func ReadYAML ¶
ReadYAML reads a YAML file and unmarshals it into the provided data structure. The data parameter must be a non-nil pointer.
func WriteString ¶
WriteString writes a string to a file, creating or truncating it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.