From 1f7d1684b85350633d7b049d7b709f30412a221b Mon Sep 17 00:00:00 2001 From: marwan-at-work Date: Tue, 6 Aug 2019 13:57:00 -0400 Subject: [PATCH] fix nil check --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index 427f737..1e5414e 100644 --- a/context.go +++ b/context.go @@ -29,7 +29,7 @@ type Context struct { func NewContext(app *App, set *flag.FlagSet, parentCtx *Context) *Context { c := &Context{App: app, flagSet: set, parentContext: parentCtx} if parentCtx != nil { - if parentCtx.Context != nil { + if parentCtx.Context == nil { parentCtx.Context = context.Background() } c.Context = parentCtx.Context