File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -827,4 +827,4 @@ references to them from within any `MarshalZerologArray(a *Array)` callback (e.g
827827own code as they will be cleared and returned to the pool after being buffered by a call to ` Context.Array() ` or ` Event.Array() ` .
828828
829829Any _ dictionary_ ` Event ` returned from ` Context.CreateDict() ` or ` Event.CreateDict() ` ** must not** be referenced after being
830- buffered by a call to ` Context.Dict() ` or ` Event.Dict() ` as they will be cleared and returned to the pool.
830+ buffered by a call to ` Array.Dict() ` , ` Context.Dict() ` , or ` Event.Dict() ` as they will be cleared and returned to the pool.
Original file line number Diff line number Diff line change @@ -265,6 +265,7 @@ func (a *Array) MACAddr(ha net.HardwareAddr) *Array {
265265func (a * Array ) Dict (dict * Event ) * Array {
266266 dict .buf = enc .AppendEndMarker (dict .buf )
267267 a .buf = append (enc .AppendArrayDelim (a .buf ), dict .buf ... )
268+ putEvent (dict )
268269 return a
269270}
270271
Original file line number Diff line number Diff line change @@ -180,11 +180,10 @@ func (e *Event) Fields(fields interface{}) *Event {
180180// Dict adds the field key with a dict to the event context.
181181// Use e.CreateDict() to create the dictionary.
182182func (e * Event ) Dict (key string , dict * Event ) * Event {
183- if e == nil {
184- return e
183+ if e != nil {
184+ dict .buf = enc .AppendEndMarker (dict .buf )
185+ e .buf = append (enc .AppendKey (e .buf , key ), dict .buf ... )
185186 }
186- dict .buf = enc .AppendEndMarker (dict .buf )
187- e .buf = append (enc .AppendKey (e .buf , key ), dict .buf ... )
188187 putEvent (dict )
189188 return e
190189}
You can’t perform that action at this time.
0 commit comments