1
1
mirror of https://github.com/wader/fq.git synced 2024-09-20 08:18:51 +03:00

interp: Return []byte value as a buffer for now

This commit is contained in:
Mattias Wadman 2021-10-19 15:44:48 +02:00
parent ce044baf7e
commit 58bf069ad5

View File

@ -57,7 +57,7 @@ func valueHas(key interface{}, a func(name string) interface{}, b func(key inter
return b(key)
}
func makeDecodeValue(dv *decode.Value) DecodeValue {
func makeDecodeValue(dv *decode.Value) interface{} {
switch vv := dv.V.(type) {
case decode.Array:
return NewArrayDecodeValue(dv, vv)
@ -96,10 +96,8 @@ func makeDecodeValue(dv *decode.Value) DecodeValue {
decodeValueBase: decodeValueBase{dv},
}
case []byte:
return decodeValue{
JQValue: gojqextra.String(string(vv)),
decodeValueBase: decodeValueBase{dv},
}
// TODO: not sure about this
return bufferViewFromBuffer(bitio.NewBufferFromBytes(vv, -1), 8)
case []interface{}:
return decodeValue{
JQValue: gojqextra.Array(vv),