Documentation ¶
Index ¶
- func Exists(path string) (bool, error)
- func ForEachLine(path string, consume func(line string)) error
- func ForEachLineWithEncoding(path string, enc encoding.Encoding, consume func(line string)) error
- func IsDirectory(path string) (bool, error)
- func IsFile(path string) (bool, error)
- func ReadAllBytes(path string) ([]byte, error)
- func ReadAllLines(path string) ([]string, error)
- func ReadAllLinesWithEncoding(path string, enc encoding.Encoding) ([]string, error)
- func ReadAllToString(path string) (string, error)
- func ReadAllToStringWithEncoding(path string, enc encoding.Encoding) (string, error)
- func ReadAllToWriter(path string, w io.Writer) error
- func WriteAllFromReader(path string, r io.Reader) error
- func WriteBytes(path string, data []byte) error
- func WriteString(path string, str string) error
- func WriteStringWithEncoding(path string, str string, enc encoding.Encoding) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForEachLine ¶ added in v1.2.0
ForEachLine read line by line from a file, and return a error if read failed.
func ForEachLineWithEncoding ¶ added in v1.2.0
ForEachLineWithEncoding read line by line from a file with specific, and return a error if read failed.
func IsDirectory ¶
IsDirectory return true if path is exists and is directory
func ReadAllBytes ¶ added in v1.1.1
ReadAllBytes read and return all data in file
func ReadAllLines ¶
ReadAllLines read all data from a file till EOF, return a lines slice.
func ReadAllLinesWithEncoding ¶
ReadAllLinesWithEncoding read all data from a file till EOF, return a lines slice.
func ReadAllToString ¶
ReadAllToString read and return all data as string in file
func ReadAllToStringWithEncoding ¶
ReadAllToStringWithEncoding read and return all data as string in file
func ReadAllToWriter ¶ added in v1.1.1
ReadAllToWriter read all data from file, into a writer
func WriteAllFromReader ¶ added in v1.1.1
WriteAllFromReader write all data from a reader, to a file.
func WriteBytes ¶ added in v1.1.1
WriteBytes write all data to file, and then close. If file already exists, will be override
func WriteString ¶
WriteString write all string content to file, and then close. If file already exists, will be override
Types ¶
This section is empty.