exec.LookPath: return os.PathError instad of os.ENOENT, it's more descriptive.

R=rsc
CC=golang-dev
https://golang.org/cl/3448042
This commit is contained in:
Michael Hoisie 2010-12-07 15:57:00 -05:00 committed by Russ Cox
parent 688a83128d
commit bfac91a6b9
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ func LookPath(file string) (string, os.Error) {
if canExec(file) {
return file, nil
}
return "", os.ENOENT
return "", &os.PathError{"lookpath", file, os.ENOENT}
}
pathenv := os.Getenv("PATH")
for _, dir := range strings.Split(pathenv, ":", -1) {
@ -41,5 +41,5 @@ func LookPath(file string) (string, os.Error) {
return dir + "/" + file, nil
}
}
return "", os.ENOENT
return "", &os.PathError{"lookpath", file, os.ENOENT}
}