diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/internal/base/base.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/go/internal/base/base.go b/src/cmd/go/internal/base/base.go index 83cbad401e..d5d5f8d36e 100644 --- a/src/cmd/go/internal/base/base.go +++ b/src/cmd/go/internal/base/base.go @@ -62,11 +62,11 @@ var Go = &Command{ // Lookup returns the subcommand with the given name, if any. // Otherwise it returns nil. // -// Lookup ignores subcommands that have len(c.Commands) == 0 and c.Run == nil. +// Lookup ignores any subcommand `sub` that has len(sub.Commands) == 0 and sub.Run == nil. // Such subcommands are only for use as arguments to "help". func (c *Command) Lookup(name string) *Command { for _, sub := range c.Commands { - if sub.Name() == name && (len(c.Commands) > 0 || c.Runnable()) { + if sub.Name() == name && (len(sub.Commands) > 0 || sub.Runnable()) { return sub } } |
