mirror of
https://github.com/golang/go
synced 2024-11-24 06:00:11 -07:00
3c7a812485
See https://go-review.googlesource.com/#/c/38313/ for background. It turns out that only a few tests checked for this. The new error message is shorter and very clear. Change-Id: I8ab4ad59fb023c8b54806339adc23aefd7dc7b07 Reviewed-on: https://go-review.googlesource.com/38314 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
25 lines
535 B
Go
25 lines
535 B
Go
// errorcheck
|
|
|
|
// Copyright 2014 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.
|
|
|
|
// The gccgo compiler did not reliably report mismatches between the
|
|
// number of function results and the number of expected results.
|
|
|
|
package p
|
|
|
|
func G() (int, int, int) {
|
|
return 0, 0, 0
|
|
}
|
|
|
|
func F() {
|
|
a, b := G() // ERROR "cannot assign"
|
|
a, b = G() // ERROR "cannot assign"
|
|
_, _ = a, b
|
|
}
|
|
|
|
func H() (int, int) {
|
|
return G() // ERROR "too many|mismatch"
|
|
}
|