mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-12-16 03:29:01 +08:00
18 lines
393 B
Go
18 lines
393 B
Go
package json
|
|
|
|
import "github.com/seaweedfs/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
|
|
}
|