diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2022-04-23 15:55:57 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2022-04-23 15:55:57 -0400 |
commit | 6416973e373a3c61aa2b44591799385c5b1b0092 (patch) | |
tree | c995139bd59fb84cfd6c8f5f447d3f646ad2b727 /src/texec/eval.go | |
parent | 4001b3aa7f02e353cc7d3e4712e2037881920d38 (diff) |
Fix an error with struct definition
Diffstat (limited to 'src/texec/eval.go')
-rw-r--r-- | src/texec/eval.go | 7 |
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] } |