fmt should not appear in the output. It's only imported by cgo_enabled.go, which contains import "C". This file is ignored because ctxt.CgoEnabled is false. Its imports should be ignored, too.
Note that if we add // +build cgo to cgo_enabled.go, the imports from that file are not included in the output.
What did you see instead?
The test script should pass.
This can be tested more concisely with go list -f {{.Imports}} ./a. The root cause of the issue is in go/build though.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
The test script fails.
fmt
should not appear in the output. It's only imported bycgo_enabled.go
, which containsimport "C"
. This file is ignored becausectxt.CgoEnabled
isfalse
. Its imports should be ignored, too.Note that if we add
// +build cgo
tocgo_enabled.go
, the imports from that file are not included in the output.What did you see instead?
The test script should pass.
This can be tested more concisely with
go list -f {{.Imports}} ./a
. The root cause of the issue is ingo/build
though.The text was updated successfully, but these errors were encountered: