cobra
cobra copied to clipboard
Closes #2193
Context is not copied from parent to child Comment on code states copy if parent has context but code implements copy if child doesn't have context Fix makes behaviour consistent between root and sub commands w.r.t. contexts
Re-pushed and removed check completely - parent context can never be nil so no point checking Context should always be copied
I concur.
This issue makes it very hard to use Cobra in tests so this would be a great fix.
@spf13 Sorry to bother you when you’re busy. I’m having trouble with this bug because the correct TraceId (otel) attached to the Context can’t be retrieved. Who can merge this?