2012-12-12 08:43:54 -07:00
|
|
|
// errorcheck
|
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2012 The Go Authors. All rights reserved.
|
2012-12-12 08:43:54 -07:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Issue 3925: wrong line number for error message "missing key in map literal"
|
|
|
|
|
|
|
|
// also a test for correct line number in other malformed composite literals.
|
|
|
|
|
|
|
|
package foo
|
|
|
|
|
|
|
|
var _ = map[string]string{
|
|
|
|
"1": "2",
|
2013-06-20 00:21:14 -06:00
|
|
|
"3", "4", // ERROR "missing key|must have keys"
|
2012-12-12 08:43:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
var _ = []string{
|
|
|
|
"foo",
|
|
|
|
"bar",
|
2013-06-20 00:21:14 -06:00
|
|
|
20, // ERROR "cannot use|incompatible type"
|
2012-12-12 08:43:54 -07:00
|
|
|
}
|
|
|
|
|