kuvia2/vendor/github.com/rs/zerolog/internal/json/base.go
2022-01-15 00:09:03 +01:00

12 lines
No EOL
279 B
Go

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, ':')
}