We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24e8d56 commit f96a18cCopy full SHA for f96a18c
cue/decode.go
@@ -280,6 +280,9 @@ func (d *decoder) interfaceValue(v Value) (x interface{}) {
280
for list.Next() {
281
a = append(a, d.interfaceValue(list.Value()))
282
}
283
+ if a == nil {
284
+ a = []interface{}{}
285
+ }
286
x = a
287
288
case StructKind:
cue/decode_test.go
@@ -231,6 +231,10 @@ func TestDecode(t *testing.T) {
231
`,
232
dst: &S{},
233
err: "Decode: x: cannot use value 1 (type int) as (string|bytes)",
234
+ }, {
235
+ value: `[]`,
236
+ dst: new(interface{}),
237
+ want: []interface{}{},
238
}}
239
for _, tc := range testCases {
240
t.Run(tc.value, func(t *testing.T) {
0 commit comments