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