Command.Context() returns nil instead of context.Background() #1578
Labels
area/cobra-command
Core `cobra.Command` implementations
lifecycle/active
Actively being worked on by a community member or maintainer. Corresponds to someone being assigned
Documentation of the Context() function states a
context.Background()
is returned, but the returned value isnil
.Go Playground
It would be really nice if this could return a
context.Background()
, so functions that take aCommand
as parameter and use the context from that command could be tested. There is also no possibility to set this context manually right now.The text was updated successfully, but these errors were encountered: