Unable to initialize a new package using cobra init --pkg-name demo command in go

259 views Asked by At
cobra init --pkg-name demo
Error: unknown flag: --pkg-name
Usage:
  cobra init [path] [flags]

Aliases:
  init, initialize, initialise, create

Flags:
  -h, --help   help for init

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

It shows me this issue. How do i solve this?

1

There are 1 answers

1
Suyash Medhavi On

You might be using an old version?

Try cobra init demo

See here and here for more details