]> Cypherpunks.ru repositories - gostls13.git/blob - test/env.go
move things out of sys into os and runtime
[gostls13.git] / test / env.go
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                 os.Exit(1);
16         }
17         if ga != "amd64" {
18                 print("$GOARCH=", ga, "\n");
19                 os.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                 os.Exit(1);
25         }
26 }