mirror of
https://github.com/golang/go
synced 2024-11-18 09:04:49 -07:00
7c0db1b7e2
Instead of errors like: ./blank2.go:15: cannot use ~b1 (type []int) as type int in assignment we now have: ./blank2.go:15: cannot use _ (type []int) as type int in assignment Less confusing for users. Fixes #9521 Change-Id: Ieab9859040e8e0df95deeaee7eeb408d3be61c0f Reviewed-on: https://go-review.googlesource.com/9902 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
17 lines
366 B
Go
17 lines
366 B
Go
// 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.
|
|
|
|
// Test that an incorrect use of the blank identifer is caught.
|
|
// Does not compile.
|
|
|
|
package main
|
|
|
|
func f() (_, _ []int) { return }
|
|
|
|
func main() {
|
|
_ = append(f()) // ERROR "cannot use _"
|
|
}
|