2012-02-17 04:51:04 +00:00
|
|
|
// errorcheck
|
2010-04-27 05:35:27 +00:00
|
|
|
|
2016-04-10 21:32:26 +00:00
|
|
|
// Copyright 2010 The Go Authors. All rights reserved.
|
2010-04-27 05:35:27 +00: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-10 05:40:25 +00:00
|
|
|
fmt.Printf("hello") // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-27 05:35:27 +00:00
|
|
|
|
|
|
|
func main() {
|
|
|
|
}
|
|
|
|
|
2010-09-10 05:40:25 +00:00
|
|
|
x++ // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-27 05:35:27 +00:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
}
|
|
|
|
|
2010-09-10 05:40:25 +00:00
|
|
|
x,y := 1, 2 // ERROR "non-declaration statement outside function body|expected declaration"
|
2010-04-27 05:35:27 +00:00
|
|
|
|