Documentation
¶
Index ¶
- func Append(path string, content string)
- func AppendHead(path string, content string)
- func Create(name string) (*os.File, error)
- func EachFiles(dir string, fn func(filename string, fi os.FileInfo)) error
- func EachFilesAppendHead(dir string, content string, options map[string]interface{}) error
- func EachFilesRemove(dir string, fn func(filename string, fi os.FileInfo) bool) error
- func EachFilesRename(dir string, fn func(oldName string) string) (err error)
- func GetFiles(dir, suffix string) (files []string, err error)
- func IsExist(fileName string) bool
- func MkdirNotExist(path string) error
- func MustCreate(name string) *os.File
- func MustReadFile(path string) []byte
- func MustReadText(path string) string
- func OpenOrCreate(name string, flag int, perm os.FileMode) (*os.File, error)
- func ReadJSON(path string, e interface{}) error
- func ReadJSONToMap(path string) (data map[string]interface{}, err error)
- func SaveFile(path string, data []byte) error
- func SaveJSON(path string, e interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EachFilesAppendHead ¶
EachFilesAppendHead 遍历目录下的所有文件,添加文件头
func EachFilesRemove ¶
EachFilesRemove 遍历文件夹,当回调函数返回true的时候删除文件 注意,当一个目录下所有文件都被删除,这个目录本身也不会被删除
func EachFilesRename ¶
批量重命名指定目录及所有子目录下的所有文件。(不会重命名目录文件)
func MustReadFile ¶
func OpenOrCreate ¶
OpenOrCreate 创建不存在的文件
func ReadJSONToMap ¶
ReadJSONToMap
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.