mirror of
https://github.com/golang/go
synced 2024-11-18 18:04:46 -07:00
go/loader: clarify the nocgo check.
LGTM=gri R=gri CC=golang-codereviews https://golang.org/cl/144910043
This commit is contained in:
parent
ab25303a78
commit
1bd4ccf210
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user