mirror of
https://github.com/golang/go
synced 2024-11-27 06:01:26 -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>
27 lines
454 B
Go
27 lines
454 B
Go
// errorcheck
|
|
|
|
// Copyright 2010 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.
|
|
|
|
// https://code.google.com/p/gofrontend/issues/detail?id=1
|
|
|
|
package main
|
|
|
|
func f1() {
|
|
a, b := f() // ERROR "cannot assign|does not match"
|
|
_ = a
|
|
_ = b
|
|
}
|
|
|
|
func f2() {
|
|
var a, b int
|
|
a, b = f() // ERROR "cannot assign|does not match"
|
|
_ = a
|
|
_ = b
|
|
}
|
|
|
|
func f() int {
|
|
return 1;
|
|
}
|