// cmd/foobar/main.go //---------------------------------------------------------------- func main() { if err := run(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } func run() { cmd := cmd.NewFoobarCommand() return cmd.Execute() } // pkg/foobar/cmd/cmd.go //---------------------------------------------------------------- func NewFoobarCommand() *cobra.Command { var ( flagVerbose bool )