Documentation
¶
Overview ¶
* @Author: cnzf1 * @Date: 2021-07-19 11:58:51 * @LastEditors: cnzf1 * @LastEditTime: 2023-01-11 11:09:34 * @Description:
Index ¶
- Constants
- func CreateIfNotExist(file string) (*os.File, error)
- func FileExists(file string) bool
- func FileNameWithoutExt(file string) string
- func MkdirIfNotExist(dir string) error
- func ReadLinesOffsetN(filename string, offset uint, n int) ([]string, error)
- func RemoveIfExist(filename string) error
- func RemoveOrQuit(filename string) error
Constants ¶
View Source
const (
NL = "\n"
)
NL defines a new line
Variables ¶
This section is empty.
Functions ¶
func CreateIfNotExist ¶
CreateIfNotExist creates a file if it is not exists
func FileExists ¶
FileExists returns true if the specified file is exists
func FileNameWithoutExt ¶
FileNameWithoutExt returns a file name without suffix
func MkdirIfNotExist ¶
MkdirIfNotExist makes directories if the input path is not exists
func ReadLinesOffsetN ¶
ReadLines reads contents from a file and splits them by new lines. A convenience wrapper to ReadLinesOffsetN(filename, 0, -1).
func RemoveIfExist ¶
RemoveIfExist deletes the specified file if it is exists
func RemoveOrQuit ¶
RemoveOrQuit deletes the specified file if read a permit command from stdin
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.