| 
									
										
										
										
											2008-09-22 17:31:41 -07: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 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-30 14:24:32 -07:00
										 |  |  | import ( | 
					
						
							|  |  |  | 	"os" | 
					
						
							|  |  |  | 	"runtime" | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2008-09-22 17:31:41 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							| 
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 |  |  | 	ga, e0 := os.Getenverror("GOARCH") | 
					
						
							| 
									
										
										
										
											2008-09-22 17:31:41 -07:00
										 |  |  | 	if e0 != nil { | 
					
						
							| 
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 |  |  | 		print("$GOARCH: ", e0.String(), "\n") | 
					
						
							|  |  |  | 		os.Exit(1) | 
					
						
							| 
									
										
										
										
											2008-09-22 17:31:41 -07:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2011-03-30 14:24:32 -07:00
										 |  |  | 	if ga != runtime.GOARCH { | 
					
						
							|  |  |  | 		print("$GOARCH=", ga, "!= runtime.GOARCH=", runtime.GOARCH, "\n") | 
					
						
							| 
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 |  |  | 		os.Exit(1) | 
					
						
							| 
									
										
										
										
											2008-09-22 17:31:41 -07:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 |  |  | 	xxx, e1 := os.Getenverror("DOES_NOT_EXIST") | 
					
						
							| 
									
										
										
										
											2008-09-22 17:31:41 -07:00
										 |  |  | 	if e1 != os.ENOENV { | 
					
						
							| 
									
										
										
										
											2010-09-04 10:36:13 +10:00
										 |  |  | 		print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.String(), "\n") | 
					
						
							|  |  |  | 		os.Exit(1) | 
					
						
							| 
									
										
										
										
											2008-09-22 17:31:41 -07:00
										 |  |  | 	} | 
					
						
							|  |  |  | } |