1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-03 01:00:04 +02:00
seaweedfs/weed/query/json/seralize.go
2019-10-06 22:35:08 -07:00

18 lines
393 B
Go

package json
import "github.com/chrislusf/seaweedfs/weed/query/sqltypes"
func ToJson(buf []byte, selections []string, values []sqltypes.Value) []byte {
buf = append(buf, '{')
for i, value := range values {
if i > 0 {
buf = append(buf, ',')
}
buf = append(buf, selections[i]...)
buf = append(buf, ':')
buf = append(buf, value.Raw()...)
}
buf = append(buf, '}')
return buf
}