]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: include function name or value in copylock message
authorRob Pike <r@golang.org>
Sat, 24 Dec 2016 21:51:21 +0000 (08:51 +1100)
committerRob Pike <r@golang.org>
Tue, 3 Jan 2017 19:23:23 +0000 (19:23 +0000)
commitd698e614a21cd50055c7c5e7100069d2bcdb9b83
tree1855b664f2295e194a7ba28140d333eebe1e8be2
parent161cd34f788ee9c6b61565eb6f865434bc135306
cmd/vet: include function name or value in copylock message

Given
var t struct{ lock sync.Mutex }
var fntab []func(t)
f(a(), b(&t), c(), fntab[0](t))

Before:
function call copies lock value: struct{lock sync.Mutex} contains sync.Mutex

After:
call of fntab[0] copies lock value: struct{lock sync.Mutex} contains sync.Mutex

This will make diagnosis easier when there are multiple function calls per line.

Change-Id: I9881713c5671b847b84a0df0115f57e7cba17d72
Reviewed-on: https://go-review.googlesource.com/34730
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/vet/copylock.go
src/cmd/vet/testdata/copylock.go
src/cmd/vet/testdata/copylock_func.go