From 7ab9095c8492ad4f2efdd2fab0cb3a4027c35845 Mon Sep 17 00:00:00 2001 From: Daz Wilkin Date: Mon, 17 Jun 2019 14:14:33 -0700 Subject: [PATCH] `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. --- cobra/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cobra/README.md b/cobra/README.md index 6054f95c..5e027d48 100644 --- a/cobra/README.md +++ b/cobra/README.md @@ -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