2010-04-26 23:35:27 -06:00
|
|
|
// errchk $G -e $D/$F.go
|
|
|
|
|
|
|
|
// Copyright 2010 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
|
|
|
|
|
2010-09-09 23:40:25 -06:00
|
|
|
fmt.Printf("hello") // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-26 23:35:27 -06:00
|
|
|
|
|
|
|
func main() {
|
|
|
|
}
|
|
|
|
|
2010-09-09 23:40:25 -06:00
|
|
|
x++ // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-26 23:35:27 -06:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
}
|
|
|
|
|
2010-09-09 23:40:25 -06:00
|
|
|
x,y := 1, 2 // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-26 23:35:27 -06:00
|
|
|
|