fix judge path func
This commit is contained in:
@@ -25,7 +25,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -65,12 +64,7 @@ func loadData(p string) ([]byte, error) {
|
||||
}
|
||||
|
||||
func isPath(path string) (bool, string) {
|
||||
p, err := filepath.Abs("")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
absPath := filepath.Join(p, strings.Replace(path, p, "", 1))
|
||||
absPath, err := filepath.Abs(path)
|
||||
_, err = os.Stat(absPath)
|
||||
if err == nil {
|
||||
return true, absPath
|
||||
|
Reference in New Issue
Block a user