摘要: ```go package main import ( "fmt" "log" "os" "path/filepath" ) // 获取可执行文件的绝对路径 func main() { // 获取可执行文件相对于当前工作目录的相对路径 root := filepath.Dir(os.Args[0]) fmt.Println(root) // 根据相对路径获取可执行文件的绝对... 阅读全文
posted @ 2018-06-01 14:07 kangeloo 阅读(2333) 评论(0) 推荐(0) 编辑
摘要: 判断文件/目录是否存在 区分目录和文件 阅读全文
posted @ 2018-06-01 10:11 kangeloo 阅读(8838) 评论(0) 推荐(1) 编辑