mirror of
https://github.com/golang/go
synced 2024-11-24 23:57:57 -07:00
os/exec: trivial allocation removal in LookPath
R=golang-dev, bsiegert, r CC=golang-dev https://golang.org/cl/5549043
This commit is contained in:
parent
ca3e6d1367
commit
01a0d39a7f
@ -47,8 +47,9 @@ func LookPath(file string) (string, error) {
|
||||
// Unix shell semantics: path element "" means "."
|
||||
dir = "."
|
||||
}
|
||||
if err := findExecutable(dir + "/" + file); err == nil {
|
||||
return dir + "/" + file, nil
|
||||
path := dir + "/" + file
|
||||
if err := findExecutable(path); err == nil {
|
||||
return path, nil
|
||||
}
|
||||
}
|
||||
return "", &Error{file, ErrNotFound}
|
||||
|
Loading…
Reference in New Issue
Block a user