2008-09-22 18:31:41 -06:00
|
|
|
// $G $F.go && $L $F.$A && ./$A.out
|
|
|
|
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import os "os"
|
|
|
|
|
|
|
|
func main() {
|
2009-06-26 21:28:41 -06:00
|
|
|
ga, e0 := os.Getenverror("GOARCH");
|
2008-09-22 18:31:41 -06:00
|
|
|
if e0 != nil {
|
|
|
|
print("$GOARCH: ", e0.String(), "\n");
|
2009-05-08 16:21:41 -06:00
|
|
|
os.Exit(1);
|
2008-09-22 18:31:41 -06:00
|
|
|
}
|
2009-06-04 12:16:03 -06:00
|
|
|
if ga != "amd64" && ga != "386" && ga != "arm" {
|
2008-09-22 18:31:41 -06:00
|
|
|
print("$GOARCH=", ga, "\n");
|
2009-05-08 16:21:41 -06:00
|
|
|
os.Exit(1);
|
2008-09-22 18:31:41 -06:00
|
|
|
}
|
2009-06-26 21:28:41 -06:00
|
|
|
xxx, e1 := os.Getenverror("DOES_NOT_EXIST");
|
2008-09-22 18:31:41 -06:00
|
|
|
if e1 != os.ENOENV {
|
|
|
|
print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.String(), "\n");
|
2009-05-08 16:21:41 -06:00
|
|
|
os.Exit(1);
|
2008-09-22 18:31:41 -06:00
|
|
|
}
|
|
|
|
}
|