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