fastpastebin/vendor/github.com/rs/zerolog/internal/cbor/base.go

11 lines
253 B
Go
Raw Normal View History

2018-04-30 18:42:17 +05:00
package cbor
2019-03-07 07:56:50 +05:00
type Encoder struct{}
2018-04-30 18:42:17 +05:00
// AppendKey adds a key (string) to the binary encoded log message
2019-03-07 07:56:50 +05:00
func (e Encoder) AppendKey(dst []byte, key string) []byte {
2018-04-30 18:42:17 +05:00
if len(dst) < 1 {
2019-03-07 07:56:50 +05:00
dst = e.AppendBeginMarker(dst)
2018-04-30 18:42:17 +05:00
}
2019-03-07 07:56:50 +05:00
return e.AppendString(dst, key)
}