fix judge path func

master
ehlxr 2018-04-13 22:42:33 +08:00
parent 4fbaca7996
commit d8c8935d0c
1 changed files with 1 additions and 6 deletions

View File

@ -95,12 +95,7 @@ func loadData(p string) []string {
}
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