cobra init no longer works as documented

`cobra init github.com/spf13/newApp` results in `Error: required flag(s) "pkg-name" not set`

This alternative works but it's not intuitive to me as a noob user that it's correct.

In order to test what it does, I tried `cobra init a --pkg-name=b` but then `main.go` attempts to (incorrectly) `import "b/cmd"`

I think (!?) I'd expect what you original had: `cobra init github.com/spf13/newApp` creating a directory under `{GOPATH}/src/github.com/spf13/newApp` with `github.com/spf13/newApp` as the package name.
This commit is contained in:
Daz Wilkin 2019-06-17 14:14:33 -07:00 committed by GitHub
parent f2b07da1e2
commit 7ab9095c84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ Cobra init is pretty smart. You can provide it a full path, or simply a path
similar to what is expected in the import.
```
cobra init github.com/spf13/newApp
cobra init ${GOPATH}/src/github.com/spf13/newApp --pkg-name=github.com/spf13/newApp
```
### cobra add