From d330c712c12397f50261ca30666b5cb35383a33d Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Fri, 26 Jun 2009 20:28:41 -0700 Subject: Getenv: almost no one wants the error, so make it return a string that may be empty. Getenverror is the new name for the old routine that returns an error too. R=rsc DELTA=35 (7 added, 7 deleted, 21 changed) OCL=30818 CL=30821 --- src/pkg/exec/exec.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/pkg/exec/exec.go') diff --git a/src/pkg/exec/exec.go b/src/pkg/exec/exec.go index 7ddb98b508..a50f9dc13a 100644 --- a/src/pkg/exec/exec.go +++ b/src/pkg/exec/exec.go @@ -208,12 +208,7 @@ func LookPath(file string) (string, os.Error) { } return "", os.ENOENT; } - pathenv, err := os.Getenv("PATH"); - if err != nil { - // Unix shell semantics: no $PATH means assume PATH="" - // (equivalent to PATH="."). - pathenv = ""; - } + pathenv := os.Getenv("PATH"); for i, dir := range strings.Split(pathenv, ":", 0) { if dir == "" { // Unix shell semantics: path element "" means "." -- cgit v1.3