README ¶ 文件类功能封装 Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func Append(file string, data []byte) error func CreateDir(path string) error func CreateFile(path string) error func FileExists(path string) bool func ReadFileAll(filepath string) ([]byte, error) func ReadTextFile(file string, fn func(text string)) error func Write(file string, data []byte) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Append ¶ added in v0.0.5 func Append(file string, data []byte) error 写文件 新内容追加在原有内容后面 func CreateDir ¶ func CreateDir(path string) error 创建目录 自动递归创建父级目录 func CreateFile ¶ func CreateFile(path string) error 创建文件 自动递归创建父级目录 func FileExists ¶ func FileExists(path string) bool 文件是否存在 func ReadFileAll ¶ func ReadFileAll(filepath string) ([]byte, error) 读取文件所有内容 func ReadTextFile ¶ func ReadTextFile(file string, fn func(text string)) error 逐行读取文本文件 func Write ¶ added in v0.0.5 func Write(file string, data []byte) error 写文件 写之前清空已有内容 Types ¶ This section is empty. Source Files ¶ View all Source files file.go Click to show internal directories. Click to hide internal directories.