]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/init.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / init.go
index b6c8c970636e3939186605129e556cf87694b732..43bb3c6503e99294480a0bbbce847e47e0372bc6 100644 (file)
@@ -1,18 +1,19 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // 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.
 
-package main
+// Verify that erroneous use of init is detected.
+// Does not compile.
 
-import "runtime"
+package main
 
 func init() {
 }
 
 func main() {
-       init()         // ERROR "undefinedinit"
-       runtime.init() // ERROR "unexported.*runtime\.init"
-       var _ = init   // ERROR "undefinedinit"
+       init()         // ERROR "undefined.*init"
+       runtime.init() // ERROR "undefined.*runtime\.init|reference to undefined name|undefined: runtime"
+       var _ = init   // ERROR "undefined.*init"
 }