t.Fatal(err)
}
- // A few tests (of things like the environment) require these to be set.
- if os.Getenv("GOOS") == "" {
- os.Setenv("GOOS", runtime.GOOS)
- }
- if os.Getenv("GOARCH") == "" {
- os.Setenv("GOARCH", runtime.GOARCH)
- }
-
var (
runInDir = tempDir
tempDirIsGOPATH = false
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Test that the Go environment variables are present and accessible through
-// package os and package runtime.
+// Test that environment variables are accessible through
+// package os.
package main
)
func main() {
- ga := os.Getenv("GOARCH")
- if ga != runtime.GOARCH {
- print("$GOARCH=", ga, "!= runtime.GOARCH=", runtime.GOARCH, "\n")
+ ga := os.Getenv("PATH")
+ if runtime.GOOS == "plan9" {
+ ga = os.Getenv("path")
+ }
+ if ga == "" {
+ print("PATH is empty\n")
os.Exit(1)
}
xxx := os.Getenv("DOES_NOT_EXIST")