When creating new commands via `cobra add`, it is not possible to add
commands with the same name to different parents. They will just
overwrite each other.
With this patch, the command's object identifier is templated
`parentCommandCmd`, the `Use` field `command` and the file name
`parent_command.go`.
Fixes#1059Fixes#1131
Signed-off-by: Carlos Marx <me@carlosmarx.com>
* fix: ensure that testproject is removed even after a failure
* fix: defer licenseFile
* style: simply defer os.RemoveAll
* cobra/cmd: add getProject test func
These tests were time-dependent and would start failing in 2018
when the golden files still have the copyright year of 2017.
Fix by hard-coding the year 2017 for the purpose of these two tests
to ensure reproducible builds.
Fixes#503