2015-05-09 11:21:42 -06:00
|
|
|
// errorcheck
|
|
|
|
|
|
|
|
// Copyright 2015 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.
|
|
|
|
|
2020-03-29 02:12:06 -06:00
|
|
|
// Test that an incorrect use of the blank identifier is caught.
|
2015-05-09 11:21:42 -06:00
|
|
|
// Does not compile.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2015-05-11 14:12:01 -06:00
|
|
|
func f() (_, _ []int) { return }
|
|
|
|
func g() (x []int, y float64) { return }
|
2015-05-09 11:21:42 -06:00
|
|
|
|
|
|
|
func main() {
|
2021-11-10 09:41:21 -07:00
|
|
|
_ = append(f()) // ERROR "cannot use \[\]int value as type int in append|cannot use.*type \[\]int.*to append"
|
|
|
|
_ = append(g()) // ERROR "cannot use float64 value as type int in append|cannot use.*type float64.*to append"
|
2015-05-09 11:21:42 -06:00
|
|
|
}
|