Documentation ¶
Overview ¶
Package base defines shared basic pieces of the gop command, in particular logging and the Command structure.
Index ¶
- Variables
- func GenGoForBuild(dir string, recursive bool, errorHandle func())
- func GetBuildDir(args []string) (dir string, recursive bool)
- func Main(c *Command, app string, args []string)
- func RunGoCmd(dir string, op string, args ...string)
- func SkipSwitches(args []string, f *flag.FlagSet) []string
- type Command
Constants ¶
This section is empty.
Variables ¶
var CmdName string
CmdName - "build", "install", "list", "mod tidy", etc.
var Gop = &Command{
UsageLine: "gop",
Short: `Gop is a tool for managing Go+ source code.`,
}
Gop command
var Usage func()
Usage is the usage-reporting function, filled in by package main but here for reference by other packages.
Functions ¶
func GenGoForBuild ¶ added in v1.0.2
GenGoForBuild Generate go code before building or installing, and cache pkgs if success
func GetBuildDir ¶ added in v1.0.2
GetBuildDir Get build directory from arguments
Types ¶
type Command ¶
type Command struct { // Run runs the command. // The args are the arguments after the command name. Run func(cmd *Command, args []string) // UsageLine is the one-line usage message. // The words between "gop" and the first flag or argument in the line are taken to be the command name. UsageLine string // Short is the short description shown in the 'gop help' output. Short string // Flag is a set of flags specific to this command. Flag flag.FlagSet // Commands lists the available commands and help topics. // The order here is the order in which they are printed by 'gop help'. // Note that subcommands are in general best avoided. Commands []*Command }
A Command is an implementation of a gop command like gop export or gop install.
func (*Command) LongName ¶
LongName returns the command's long name: all the words in the usage line between "gop" and a flag or argument,
func (*Command) Name ¶
Name returns the command's short name: the last word in the usage line before a flag or argument.