diff options
author | Russ Cox <rsc@golang.org> | 2013-09-11 14:42:34 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2013-09-11 14:42:34 -0400 |
commit | aa14b90a4a80ce0a703c8ea3e41823f4a6ad85b7 (patch) | |
tree | a807a547ae22c9d21cafc86c8c9fe9e04c9447a5 /src/cmd/api | |
parent | 34c8581d387ceb714d8a3a0cd2b795ccebdb4aa6 (diff) | |
download | go-aa14b90a4a80ce0a703c8ea3e41823f4a6ad85b7.tar.gz |
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 issue 6124
TBR=golang-dev
CC=golang-dev
https://codereview.appspot.com/13385046
Diffstat (limited to 'src/cmd/api')
-rw-r--r-- | src/cmd/api/goapi.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go index 7102e9d40..a62c87421 100644 --- a/src/cmd/api/goapi.go +++ b/src/cmd/api/goapi.go @@ -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)) } } |