This commit is contained in:
zhaoxiaorong
2025-02-07 13:01:38 +08:00
parent ebcdfe1ee8
commit 57a0d8ae81
52 changed files with 3313 additions and 0 deletions

35
utils/dir.go Normal file
View File

@@ -0,0 +1,35 @@
package utils
import (
"os"
)
func PathExists(path string) bool {
_, err := os.Stat(path)
if err != nil {
if os.IsExist(err) {
return true
}
return false
}
return true
}
// 创建文件夹
func CreateDir(dirName string) bool {
err := os.Mkdir(dirName, 0755)
if err != nil {
return false
}
return true
}
func GetRunPath() string {
path, _ := os.Executable()
return path
}
func GetCurrentPath() string {
path, _ := os.Getwd()
return path
}