Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue: decode empty list as empty slice instead of slice-typed nil
These three cases weren't consistent, since using cue.Value.Decode on an empty interface type as a destination would result in nil: { value: `[]`, dst: new(interface{}), want: ([]interface{})(nil), }, { value: `[]`, dst: new([]interface{}), want: []interface{}{}, }, { value: `[]`, dst: new([]int), want: []int{}, } Now all result in an empty slice, which is consistent and intuitive. Closes #2471 as merged as of commit f96a18c. Signed-off-by: Artem V. Navrotskiy <[email protected]> Change-Id: I040c09343df12a153e6b2ee645ec9fd118b524ee Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1167647 Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]>
- Loading branch information