schnutibox/vendor/github.com/rs/zerolog/internal/json/base.go

12 lines
253 B
Go
Raw Normal View History

2021-03-30 19:59:26 +02: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 dst[len(dst)-1] != '{' {
dst = append(dst, ',')
}
return append(e.AppendString(dst, key), ':')
}