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
diff --git a/test/env.go b/test/env.go
index db76ee4..2cf9ddf 100644
--- a/test/env.go
+++ b/test/env.go
@@ -9,7 +9,7 @@
import os "os"
func main() {
- ga, e0 := os.Getenv("GOARCH");
+ ga, e0 := os.Getenverror("GOARCH");
if e0 != nil {
print("$GOARCH: ", e0.String(), "\n");
os.Exit(1);
@@ -18,7 +18,7 @@
print("$GOARCH=", ga, "\n");
os.Exit(1);
}
- xxx, e1 := os.Getenv("DOES_NOT_EXIST");
+ xxx, e1 := os.Getenverror("DOES_NOT_EXIST");
if e1 != os.ENOENV {
print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.String(), "\n");
os.Exit(1);