-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
Hey there, I'm quite new to go and cobra, but I'm leveraging the framework to build some tools for work and loving it.
I've been trying to set up testing for my project, but I'm wondering how other people using cobra are implementing testing for sub-commands. The typical go example led me to believe that in the cmds folder, i would make a command x.go and then create a test x_test.go. Because of the way that all of the commands are passed to the root command, I don't believe this is possible.
To other users, how would you suggest doing testing on your sub-commands? If this isn't just a noob misunderstanding, maybe it would be good to add a best practice for testing into the main readme?
wedneyyuri, jjti, uded, richard-mauri, Elph and 93 more
Metadata
Metadata
Assignees
Labels
No labels