]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: check that C receivers are cgo imports
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 13 Jun 2017 15:22:06 +0000 (16:22 +0100)
committerRob Pike <r@golang.org>
Wed, 9 Aug 2017 02:23:51 +0000 (02:23 +0000)
commitbef0055a0ae8c79c9a008b17356521afda1bce85
tree233eabaf1eed1237da03fbcb8276195f7e377d91
parent561b147e4be4732c85f2725c7e12ab0a3577c962
cmd/vet: check that C receivers are cgo imports

Otherwise, vet might have false positives when "C" is a variable and
we're just using a method on it. Or when an import was renamed to "C".

Add test files for both of these cases.

Fixes #20655.

Change-Id: I55fb93119444a67fcf7891ad92653678cbd4670e
Reviewed-on: https://go-review.googlesource.com/45551
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/vet/cgo.go
src/cmd/vet/testdata/cgo/cgo2.go
src/cmd/vet/testdata/cgo/cgo4.go [new file with mode: 0644]