Documentation ¶
Index ¶
- func Exists(path string) (bool, error)
- func IsDirectory(path string) (bool, error)
- func IsFile(path string) (bool, error)
- func ReadAll(path string) ([]byte, error)
- func ReadAllLines(path string) ([]string, error)
- func ReadAllLinesWithEncoding(path string, encoding encoding.Encoding) ([]string, error)
- func ReadAllToString(path string) (string, error)
- func ReadAllToStringWithEncoding(path string, encoding encoding.Encoding) (string, error)
- func ReadLines(path string, consume func(line string)) error
- func ReadLinesWithEncoding(path string, encoding encoding.Encoding, consume func(line string)) error
- func Write(path string, data []byte) error
- func WriteString(path string, str string) error
- func WriteStringWithEncoding(path string, str string, encoding 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 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 ReadLinesWithEncoding ¶
func ReadLinesWithEncoding(path string, encoding encoding.Encoding, consume func(line string)) error
Read line by line from a file with specific, and return a error if read failed.
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.