blob: 8b995f5b7cb91cc3f536d9da286003917345cd4a [file] [log] [blame]
Rob Pike4d12c0e2008-09-22 17:31:41 -07001// $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
7package main
8
9import os "os"
10
11func 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}