Documentation
¶
Overview ¶
Go-fileutils contains a set of functions to handl files I need in several projects and don't want to copy because of the DRY principle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // No config file found ErrNoConfigFile = errors.New("no config file found") )
Functions ¶
func GetBytesFromPath ¶
GetBytesFromPath returns the content of the given file as []byte and its length. If an error occurs, it is returned instead.
func SearchConfigFile ¶
SearchConfigFile searches for config files named <modname>.<fileext> in the following locations
- current working directory
- <user specific config directory (most ~/.config)>/<modname>
- /usr/local/etc/<modname>
- /etc/<modname>
The first existing file is returned. If none is found, an error is returned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.