2012-02-16 21:51:04 -07:00
|
|
|
// errorcheck
|
2010-04-26 23:35:27 -06:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2010 The Go Authors. All rights reserved.
|
2010-04-26 23:35:27 -06:00
|
|
|
// 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
|
|
|
|