Documentation ¶
Index ¶
- func CreateDir(path string) error
- func CreateFile(path string) error
- func FileSuffix(file string) string
- func GetCurrentPath() string
- func IsExist(path string) bool
- func JoinPath(path string) string
- func MustCreateDirAndFile(path string)
- func MustCreateFile(filepath string)
- func MustMkdir(path string)
- func ToForwardSlash(path string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDir ¶
CreateDir @Date 2023-02-20 15:42:10 @Param dir string @Return error @Method @Description: 创建一个文件夹,如果文件夹已存在则不会返回错误
func CreateFile ¶
CreateFile @Date 2023-02-20 15:36:23 @Description: 根据路径创建一个文件,如果文件夹不存在,则先创建文件夹,再创建文件
func FileSuffix ¶
FileSuffix @Date 2023-02-20 14:55:19 @Param file string @Return string @Description: 获取一个文件的后缀
func GetCurrentPath ¶
func GetCurrentPath() string
GetCurrentPath @Date 2023-01-13 19:42:52 @Return string @Description: 获取当前执行文件的系统绝对路径
func IsExist ¶
IsExist @Date 2023-01-12 18:04:48 @Param path string @Return bool @Description: 判断一个文件或者文件夹是否存在
func JoinPath ¶
JoinPath @Date 2023-01-13 21:44:17 @Param path string @Return string @Description: 如果是相对路径就拼接,如果是绝对路径就返回
func MustCreateDirAndFile ¶
func MustCreateDirAndFile(path string)
MustCreateDirAndFile @Date 2023-01-12 18:19:36 @Param filepath string @Description: 必须创建文件,否则就panic
func MustCreateFile ¶
func MustCreateFile(filepath string)
MustCreateFile @Date 2023-01-12 18:21:26 @Param filepath string @Description: 必须创建文件,否则就panic
func MustMkdir ¶
func MustMkdir(path string)
MustMkdir @Date 2023-01-12 18:11:35 @Param path string @Description: 必须创建文件夹,否则就panic
func ToForwardSlash ¶
ToForwardSlash @Date 2023-02-20 16:09:25 @Description: 路径正斜杠
Types ¶
This section is empty.