d5 / tengo

A fast script language for Go

Home Page:https://tengolang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FromInterface support

KaranaLJX opened this issue · comments

I found that the FromInterface interface does not support types such as [] string and [] int. If such types are passed in, you need to do the conversion yourself to [] interface {}. I would like to ask if there are any suggestions besides doing the conversion yourself.

I think the correct approach is to use reflect to obtain the type of interface like the JSON library, instead of directly using swith v. (type), which makes pointer types, arrays, and other types incompatible