2012-02-17 04:50:37 +00:00
|
|
|
// errorcheck
|
2011-03-02 21:18:17 +00: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 07:47:26 +00:00
|
|
|
// Verify that erroneous use of init is detected.
|
|
|
|
// Does not compile.
|
|
|
|
|
2011-03-02 21:18:17 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2017-03-06 23:41:56 +00:00
|
|
|
init() // ERROR "undefined.*init"
|
2020-12-14 19:53:55 +00:00
|
|
|
runtime.init() // ERROR "undefined.*runtime\.init|reference to undefined name|undefined: runtime"
|
2017-03-06 23:41:56 +00:00
|
|
|
var _ = init // ERROR "undefined.*init"
|
2011-03-02 21:18:17 +00:00
|
|
|
}
|