go/src/cmd/go/internal/base/base.go

type Command

var Go

// 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.
// Such subcommands are only for use as arguments to "help".
func (c *Command) Lookup(name string) *Command {}

// hasFlag reports whether a command or any of its subcommands contain the given
// flag.
func hasFlag(c *Command, name string) bool {}

// LongName returns the command's long name: all the words in the usage line between "go" and a flag or argument,
func (c *Command) LongName() string {}

// Name returns the command's short name: the last word in the usage line before a flag or argument.
func (c *Command) Name() string {}

func (c *Command) Usage() {}

// Runnable reports whether the command can be run; otherwise
// it is a documentation pseudo-command such as importpath.
func (c *Command) Runnable() bool {}

var atExitFuncs

func AtExit(f func()) {}

func Exit() {}

func Fatalf(format string, args ...any) {}

func Errorf(format string, args ...any) {}

func ExitIfErrors() {}

func Error(err error) {}

func Fatal(err error) {}

var exitStatus

var exitMu

func SetExitStatus(n int) {}

func GetExitStatus() int {}

// Run runs the command, with stdout and stderr
// connected to the go command's own stdout and stderr.
// If the command fails, Run reports the error using Errorf.
func Run(cmdargs ...any) {}

// RunStdin is like run but connects Stdin.
func RunStdin(cmdline []string) {}

var Usage