1
0
mirror of https://github.com/golang/go synced 2024-09-24 21:10:12 -06:00
go/test/fixedbugs/issue8311.go
Russ Cox 52e9bcafe1 cmd/gc: print x++ (not x += 1) in errors about x++
Fixes #8311.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://golang.org/cl/146270043
2014-09-25 13:13:02 -04:00

17 lines
317 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.
// issue 8311.
// error for x++ should say x++ not x += 1
package p
func f() {
var x []byte
x++ // ERROR "invalid operation: x[+][+]"
}