cmd
v0.0.3
Documentation
pkg.go.dev ↗Variables
Licenses
var Licenses = make(map[string]License)
Licenses contains all possible licenses a user can choose from.
Functions
Execute
func Execute()
Execute executes the root command.
Types
License
type License struct {
Name string // The type of license in use
PossibleMatches []string // Similar names to guess
Text string // License text data
Header string // License header for source files
}
License represents a software license agreement, containing the Name of the license, its possible matches (on the command line as given to cobra), the header to be used with each file on the file's creating, and the text of the license
Project
type Project struct {
// contains filtered or unexported fields
}
Project contains name, license and paths to projects.
NewProject
func NewProject(projectName string) *Project
NewProject returns Project with specified project name.
NewProjectFromPath
func NewProjectFromPath(absPath string) *Project
NewProjectFromPath returns Project with specified absolute path to package.
Project.AbsPath
func (p Project) AbsPath() string
AbsPath returns absolute path of project.
Project.CmdPath
func (p *Project) CmdPath() string
CmdPath returns absolute path to directory, where all commands are located.
Project.License
func (p *Project) License() License
License returns the License object of project.
Project.Name
func (p Project) Name() string
Name returns the name of project, e.g. "github.com/spf13/cobra"
Project.SrcPath
func (p *Project) SrcPath() string
SrcPath returns absolute path to $GOPATH/src where project is located.