Documentation ¶
Index ¶
- func Exists(path string) (bool, 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 ReadLines(path string, consume func(line string)) error
- func ReadLinesWithEncoding(path string, enc encoding.Encoding, consume func(line string)) 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 IsDirectory ¶
Return true if path is exists and is directory
func ReadAllBytes ¶ added in v1.1.1
Read and return all data in file
func ReadAllLines ¶
Read all data from a file till EOF, return a lines slice.
func ReadAllLinesWithEncoding ¶
Read all data from a file till EOF, return a lines slice.
func ReadAllToString ¶
Read and return all data as string in file
func ReadAllToStringWithEncoding ¶
Read and return all data as string in file
func ReadAllToWriter ¶ added in v1.1.1
Read all data from file, into a writer
func ReadLinesWithEncoding ¶
Read line by line from a file with specific, and return a error if read failed.
func WriteAllFromReader ¶ added in v1.1.1
Write all data from a reader, to a file.
func WriteBytes ¶ added in v1.1.1
Write all data to file, and then close. If file already exists, will be override
func WriteString ¶
Write all string content to file, and then close. If file already exists, will be override
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.