blob: 16b2076447f4e0f6c89549166a10baf63385ff2e [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() {
Rob Pike4f61fc92010-09-04 10:36:13 +100012 ga, e0 := os.Getenverror("GOARCH")
Rob Pike4d12c0e2008-09-22 17:31:41 -070013 if e0 != nil {
Rob Pike4f61fc92010-09-04 10:36:13 +100014 print("$GOARCH: ", e0.String(), "\n")
15 os.Exit(1)
Rob Pike4d12c0e2008-09-22 17:31:41 -070016 }
Russ Cox3a0df4c2009-06-04 11:16:03 -070017 if ga != "amd64" && ga != "386" && ga != "arm" {
Rob Pike4f61fc92010-09-04 10:36:13 +100018 print("$GOARCH=", ga, "\n")
19 os.Exit(1)
Rob Pike4d12c0e2008-09-22 17:31:41 -070020 }
Rob Pike4f61fc92010-09-04 10:36:13 +100021 xxx, e1 := os.Getenverror("DOES_NOT_EXIST")
Rob Pike4d12c0e2008-09-22 17:31:41 -070022 if e1 != os.ENOENV {
Rob Pike4f61fc92010-09-04 10:36:13 +100023 print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.String(), "\n")
24 os.Exit(1)
Rob Pike4d12c0e2008-09-22 17:31:41 -070025 }
26}