]> Cypherpunks repositories - gostls13.git/commit
go/build: reject directory with only cgo files if cgo not in use
authorRuss Cox <rsc@golang.org>
Wed, 11 Sep 2013 17:25:30 +0000 (13:25 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 11 Sep 2013 17:25:30 +0000 (13:25 -0400)
commit611b182190e759879b3988077daf7d52eb831b5e
treee8091d470ceb302dec2cfecd392326a226bbab2f
parentfdaf88ea5b7a3bc937e68875d55b5741ecb2f092
go/build: reject directory with only cgo files if cgo not in use

The old test for "no Go files" was p.Name == "", meaning we never
saw a Go package statement. That test fails if there are cgo files
that we parsed (and recorded the package name) but then chose
not to use (because cgo is not available).

Test the actual file lists instead.

Fixes #6078.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/13661043
src/cmd/go/test.bash
src/cmd/go/testdata/src/cgotest/m.go [new file with mode: 0644]
src/pkg/go/build/build.go