Reputation: 19342
I have an empty dir with a go project, with only go.mod
being present (I have run the go mod init
command)
▶ cat go.mod
module github.com/myorganization/mytool
go 1.13
I would expect that the following command:
▶ ~/go/bin/cobra init mytool
would scaffold the area with boilerplate code so that I start creating my cli tool.
Instead I am getting the following error message:
▶ ~/go/bin/cobra init mytool
Error: required flag(s) "pkg-name" not set
Usage:
cobra init [name] [flags]
Aliases:
init, initialize, initialise, create
Flags:
-h, --help help for init
--pkg-name string fully qualified pkg name
Global Flags:
-a, --author string author name for copyright attribution (default "YOUR NAME")
--config string config file (default is $HOME/.cobra.yaml)
-l, --license string name of license for the project
--viper use Viper for configuration (default true)
Why is the package name needed?
Isn't this an issue in the responsibility of go modules
?
Upvotes: 1
Views: 2005