From cc47babc7e6deedc3ded2f210577f2156ceaaa01 Mon Sep 17 00:00:00 2001 From: Anders Wallin Date: Thu, 15 Aug 2019 10:36:27 +0800 Subject: [PATCH] Fixed bug with context not being set. --- llogger.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llogger.go b/llogger.go index 28af1e1..31c22d0 100644 --- a/llogger.go +++ b/llogger.go @@ -181,10 +181,13 @@ func Create(ctx context.Context, inp Input) *Client { // the context on each iteration. func (l *Client) UpdateContext(ctx context.Context) { // If context is nil there is no need to set the context. - if l.context == nil { + if ctx == nil { return } + // Set context. + l.context = ctx + // If we can't get Deadline from context set context to nil and // print an error message. d, ok := l.context.Deadline()