| 
									
										
										
										
											2012-02-16 23:50:37 -05:00
										 |  |  | // errorcheck | 
					
						
							| 
									
										
										
										
											2011-03-02 16:18:17 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | // Copyright 2011 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. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-23 18:47:26 +11:00
										 |  |  | // Verify that erroneous use of init is detected. | 
					
						
							|  |  |  | // Does not compile. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-02 16:18:17 -05:00
										 |  |  | package main | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import "runtime" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func init() { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							| 
									
										
										
										
											2011-03-26 11:24:02 -07:00
										 |  |  | 	init()         // ERROR "undefined.*init" | 
					
						
							| 
									
										
										
										
											2011-03-02 16:18:17 -05:00
										 |  |  | 	runtime.init() // ERROR "unexported.*runtime\.init" | 
					
						
							| 
									
										
										
										
											2011-03-26 11:24:02 -07:00
										 |  |  | 	var _ = init   // ERROR "undefined.*init" | 
					
						
							| 
									
										
										
										
											2011-03-02 16:18:17 -05:00
										 |  |  | } |