matrix-handler/vendor/github.com/rs/zerolog/internal/json/base.go

12 lines
279 B
Go
Raw Permalink Normal View History

2021-02-04 07:25:16 +00:00
package json
type Encoder struct{}
// AppendKey appends a new key to the output JSON.
func (e Encoder) AppendKey(dst []byte, key string) []byte {
if len(dst) > 1 && dst[len(dst)-1] != '{' {
dst = append(dst, ',')
}
dst = e.AppendString(dst, key)
return append(dst, ':')
}