1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:28:32 -06:00

go/loader: clarify the nocgo check.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/144910043
This commit is contained in:
Alan Donovan 2014-09-15 12:03:05 -04:00
parent ab25303a78
commit 1bd4ccf210

View File

@ -120,8 +120,10 @@ func TestCgoOption(t *testing.T) {
case "plan9", "solaris", "windows":
return
}
// For linux-amd64-nocgo, cgo is not used.
if runtime.GOOS == "linux" && runtime.GOARCH == "amd64" && !build.Default.CgoEnabled {
// In nocgo builds (e.g. linux-amd64-nocgo),
// there is no "runtime/cgo" package,
// so cgo-generated Go files will have a failing import.
if !build.Default.CgoEnabled {
return
}
// Test that we can load cgo-using packages with