]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: diagnose using Printf on a function value
authorRob Pike <r@golang.org>
Mon, 31 Aug 2015 21:36:36 +0000 (14:36 -0700)
committerRob Pike <r@golang.org>
Wed, 2 Sep 2015 17:58:04 +0000 (17:58 +0000)
commit43a7a9cf43319b2a473c9c3f604a694965e78903
treef45210ce84350294e33a1bf0d2501aeffe9b5ba0
parent5f2cda5867c333e52d876e12b9e2f606806753c3
cmd/vet: diagnose using Printf on a function value

Printing a function value is nearly useless outside of debugging, but
can occur by mistake when one forgets to call it. Diagnose this.

I did this myself just the other day and it arose in cl/14031.
Easy to fix and seems worthwhile.

Fixes #12295.

Change-Id: Ice125a84559f0394f7fa7272b5d31ae602b07f83
Reviewed-on: https://go-review.googlesource.com/14122
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/cmd/vet/print.go
src/cmd/vet/testdata/print.go