mirror of
https://github.com/rs/zerolog
synced 2026-06-08 17:13:30 +00:00
enable adding raw JSON to an array (#145)
* enable adding JSON to an array * do not forget the comment
This commit is contained in:
@@ -85,6 +85,12 @@ func (a *Array) Hex(val []byte) *Array {
|
||||
return a
|
||||
}
|
||||
|
||||
// RawJSON adds already encoded JSON to the array.
|
||||
func (a *Array) RawJSON(val []byte) *Array {
|
||||
a.buf = appendJSON(enc.AppendArrayDelim(a.buf), val)
|
||||
return a
|
||||
}
|
||||
|
||||
// Err serializes and appends the err to the array.
|
||||
func (a *Array) Err(err error) *Array {
|
||||
marshaled := ErrorMarshalFunc(err)
|
||||
|
||||
Reference in New Issue
Block a user