From 38bc297a3db027003d165efe3483872065b4e00c Mon Sep 17 00:00:00 2001 From: Haoran Xu Date: Fri, 29 Mar 2019 14:04:26 +0800 Subject: [PATCH] return new entry for Entry.WithContext --- entry.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/entry.go b/entry.go index 3d2c9e0..63e2558 100644 --- a/entry.go +++ b/entry.go @@ -103,8 +103,7 @@ func (entry *Entry) WithError(err error) *Entry { // Add a context to the Entry. func (entry *Entry) WithContext(ctx context.Context) *Entry { - entry.Context = ctx - return entry + return &Entry{Logger: entry.Logger, Data: entry.Data, Time: entry.Time, err: entry.err, Context: ctx} } // Add a single field to the Entry.