1
0
mirror of https://github.com/golang/go synced 2024-11-18 04:04:49 -07:00
go/test/fixedbugs/bug289.go
Robert Griesemer 3c7a812485 cmd/compile: eliminate "assignment count mismatch" - not needed anymore
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>
2017-03-17 00:31:35 +00:00

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;
}