| 1 |
// errorcheck |
| 2 |
|
| 3 |
// Copyright 2016 The Go Authors. All rights reserved. |
| 4 |
// Use of this source code is governed by a BSD-style |
| 5 |
// license that can be found in the LICENSE file. |
| 6 |
|
| 7 |
// Test that > 10 non-syntax errors on the same line |
| 8 |
// don't lead to early exit. Specifically, here test |
| 9 |
// that we see the initialization error for variable |
| 10 |
// s. |
| 11 |
|
| 12 |
package main |
| 13 |
|
| 14 |
type T struct{} |
| 15 |
|
| 16 |
func main() { |
| 17 |
t := T{X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1, X: 1} // ERROR "unknown field 'X' in struct literal of type T|unknown field .*X.* in .*T.*" |
| 18 |
_ = t |
| 19 |
var s string = 1 // ERROR "cannot use 1|incompatible type|cannot convert" |
| 20 |
_ = s |
| 21 |
} |