fix judge path func
This commit is contained in:
parent
4fbaca7996
commit
d8c8935d0c
@ -95,12 +95,7 @@ func loadData(p string) []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isPath(path string) (bool, string) {
|
func isPath(path string) (bool, string) {
|
||||||
p, err := filepath.Abs("")
|
absPath, err := filepath.Abs(path)
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
absPath := filepath.Join(p, strings.Replace(path, p, "", 1))
|
|
||||||
_, err = os.Stat(absPath)
|
_, err = os.Stat(absPath)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return true, absPath
|
return true, absPath
|
||||||
|
Loading…
Reference in New Issue
Block a user