Documentation ¶
Index ¶
- func CreateDir(dirs ...string) (err error)
- func FileMove(src string, dst string) (err error)
- func GetDirListNoRecursion(path string) ([]string, error)
- func PathExists(path string) (bool, error)
- func ReadFileSplitEnter(filePath string) ([]string, error)
- func WriteStringWithEnter(dataStr, fp string) error
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDirListNoRecursion ¶
func PathExists ¶
Example ¶
var ( readMe string exists bool err error ) // 存在文件形式 readMe = "./README.md" if exists, err = PathExists(readMe); err != nil { return } fmt.Println(exists) readMe = "./log/README.md" if exists, err = PathExists(readMe); err != nil { return } fmt.Println(exists) // 不存在文件,只是单纯的目录 readMe = "./" if exists, err = PathExists(readMe); err != nil { return } fmt.Println(exists) readMe = "./log" if exists, err = PathExists(readMe); err != nil { return } fmt.Println(exists) // 不存在的文件 readMe = "./l.log" if exists, err = PathExists(readMe); err != nil { fmt.Println(err) return } fmt.Println(exists)
Output: true false true false false
func ReadFileSplitEnter ¶
func WriteStringWithEnter ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.