You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
279 B
12 lines
279 B
6 years ago
|
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, ':')
|
||
|
}
|