summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-04-23 15:55:57 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-04-23 15:55:57 -0400
commit6416973e373a3c61aa2b44591799385c5b1b0092 (patch)
treec995139bd59fb84cfd6c8f5f447d3f646ad2b727
parent4001b3aa7f02e353cc7d3e4712e2037881920d38 (diff)
Fix an error with struct definition
-rw-r--r--src/texec/eval.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/texec/eval.go b/src/texec/eval.go
index a977042..37341a5 100644
--- a/src/texec/eval.go
+++ b/src/texec/eval.go
@@ -478,7 +478,12 @@ func cvsa(sct TArtifact, dat []interface{}) VarMap {
for i:=0;i<len(vars);i++ {
tmp := TVariable{vars[i].Type, nil}
if isStruct(vars[i].Type, 0) {
- tmp.Data = cvsa(vars[i].Type.T, dat[i].([]interface{}))
+ switch v := dat[i].(type) {
+ case []interface{}:
+ tmp.Data = cvsa(vars[i].Type.T, v)
+ case VarMap:
+ tmp.Data = csts(vars[i].Type.T, v)
+ }
} else {
tmp.Data = dat[i]
}