Documentation ¶
Overview ¶
Package fileutil provides utility functions related to files.
Index ¶
- func Append(path, content string, doNotCreateIfDoesNotExist ...bool) error
- func FileExists(path string) bool
- func MustReadConfigFile(filename string, locations []string) ([]byte, string)
- func MustReadFile(filename string) []byte
- func ReadConfigFile(filename string, locations []string) ([]byte, string, error)
- func ReadFile(filename string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustReadConfigFile ¶ added in v0.6.0
MustReadConfigFile checks if a file exists in one of the configuration directories and returns the content. If no file is found, mytoken exists.
func MustReadFile ¶
MustReadFile reads a given file and returns the content. If an error occurs mytoken terminates.
func ReadConfigFile ¶
ReadConfigFile checks if a file exists in one of the configuration directories and returns the content. If no file is found, mytoken returns an error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.