mirror of
https://github.com/golang/go.git
synced 2024-09-28 22:06:49 +00:00
cmd/api: fix tool for recent go/build change
Asking about runtime/cgo when CgoEnabled=false now correctly returns an error from build.Import (specifically, NoGoError), because there are no buildable Go files in that directory. The API tool was depending on it returning a package with no Go files instead. Correct that assumption. Fixes all.bash on local machines. (Dashboard appears not to be running the api tool at all.) Update #6124 TBR=golang-dev CC=golang-dev https://golang.org/cl/13385046
This commit is contained in:
parent
6624b70866
commit
cdc5356c93
@ -145,6 +145,10 @@ func main() {
|
||||
// going to change w/o a language change.
|
||||
// - We don't care about the API of commands.
|
||||
if name != "unsafe" && !strings.HasPrefix(name, "cmd/") {
|
||||
if name == "runtime/cgo" && !context.CgoEnabled {
|
||||
// w.Import(name) will return nil
|
||||
continue
|
||||
}
|
||||
w.export(w.Import(name))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user