2010-04-26 22:35:27 -07: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 22:40:25 -07:00
|
|
|
fmt.Printf("hello") // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-26 22:35:27 -07:00
|
|
|
|
|
|
|
func main() {
|
|
|
|
}
|
|
|
|
|
2010-09-09 22:40:25 -07:00
|
|
|
x++ // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-26 22:35:27 -07:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
}
|
|
|
|
|
2010-09-09 22:40:25 -07:00
|
|
|
x,y := 1, 2 // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-26 22:35:27 -07:00
|
|
|
|