Rob Pike | 4d12c0e | 2008-09-22 17:31:41 -0700 | [diff] [blame] | 1 | // $G $F.go && $L $F.$A && ./$A.out |
| 2 | |
| 3 | // Copyright 2009 The Go Authors. All rights reserved. |
| 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | package main |
| 8 | |
| 9 | import os "os" |
| 10 | |
| 11 | func main() { |
| 12 | ga, e0 := os.Getenv("GOARCH"); |
| 13 | if e0 != nil { |
| 14 | print("$GOARCH: ", e0.String(), "\n"); |
| 15 | sys.exit(1); |
| 16 | } |
| 17 | if ga != "amd64" { |
| 18 | print("$GOARCH=", ga, "\n"); |
| 19 | sys.exit(1); |
| 20 | } |
| 21 | xxx, e1 := os.Getenv("DOES_NOT_EXIST"); |
| 22 | if e1 != os.ENOENV { |
| 23 | print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.String(), "\n"); |
| 24 | sys.exit(1); |
| 25 | } |
| 26 | } |