diff --git a/internal/tiltfile/encoding/starlark.go b/internal/tiltfile/encoding/starlark.go index 05678ea4b4..395449b944 100644 --- a/internal/tiltfile/encoding/starlark.go +++ b/internal/tiltfile/encoding/starlark.go @@ -61,7 +61,7 @@ func convertStarlarkToStructuredData(v starlark.Value) (interface{}, error) { case starlark.Float: return float64(v), nil case *starlark.List: - var ret []interface{} + ret := []interface{}{} it := v.Iterate() defer it.Done() diff --git a/internal/tiltfile/encoding/yaml_test.go b/internal/tiltfile/encoding/yaml_test.go index fb70d5f15d..5286ea19d0 100644 --- a/internal/tiltfile/encoding/yaml_test.go +++ b/internal/tiltfile/encoding/yaml_test.go @@ -305,6 +305,7 @@ key5: 3 key6: - foo - 7 +key7: [] ''' observed = encode_yaml({ 'key1': 'foo', @@ -316,7 +317,8 @@ observed = encode_yaml({ 'key6': [ 'foo', 7, - ] + ], + 'key7': [] }) load('assert.tilt', 'assert')