cmd/go: make use of Runnable method

Reported via unsupported Github pull request: #9299

Change-Id: I0e98dd68cbc68fcc6bcec15c5b33f20b6a861ec6
Reviewed-on: https://go-review.googlesource.com/3025
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Mikio Hara 2015-01-19 17:19:46 +09:00
parent 95864504d2
commit 9ccbd027dd

View file

@ -153,7 +153,7 @@ func main() {
}
for _, cmd := range commands {
if cmd.Name() == args[0] && cmd.Run != nil {
if cmd.Name() == args[0] && cmd.Runnable() {
cmd.Flag.Usage = func() { cmd.Usage() }
if cmd.CustomFlags {
args = args[1:]