ZRY 1 年之前
父節點
當前提交
364edce5c0
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      pathutils.go

+ 7 - 7
pathutils.go

@@ -1,15 +1,15 @@
 package pathutils
 
 import (
-	"path/filepath"
+	"io"
 	"os"
+	"path/filepath"
 	"strings"
-	"io"
 )
 
-func GetCurrentDirectory() (string,error) {
+func GetCurrentDirectory() (string, error) {
 	dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
-	return strings.Replace(dir, "\\", "/", -1),err
+	return strings.Replace(dir, "\\", "/", -1), err
 }
 
 func PathExists(path string) (bool, error) {
@@ -42,9 +42,9 @@ func CopyFile(dstName, srcName string) (written int64, err error) {
 	return io.Copy(dst, src)
 }
 
-func MkDirIfNotExist(path string, perm os.FileMode) error{
-	if r,err := PathExists(path); ((!r) || (err != nil)) {
-		if err := os.MkdirAll(path, perm);err != nil {
+func MkDirIfNotExist(path string, perm os.FileMode) error {
+	if r, err := PathExists(path); (!r) || (err != nil) {
+		if err := os.MkdirAll(path, perm); err != nil {
 			return err
 		}
 	}