I'm very new to Go in general, and this is my first project in Cobra.
It seems easy enough to create commands in Cobra with the command-line tool:
cobra add <command>
And adding sub-commands seems easy enough as well.
cobra add <subcommand> -p '<command>'
Where I've run into an issue is having two sub-commands for two different commands, but having the sub-commands have the same name. For instance:
I may have a command named 'people' and a command named 'places'.
cobra add people
cobra add places
Each command needs its own sub-command called 'add'.
cobra add add -p 'people'
cobra add add -p 'places'
The second command will fail because it will attempt to create an 'add.go' file which was already created by the first command. Is it possible to add sub-commands of the same name to different parent commands? Where the end result would be something like:
people add --first "bob" --last "smith"
places add "someplace" --zip "12345"