tengo icon indicating copy to clipboard operation
tengo copied to clipboard

FromInterface support

Open KaranaLJX opened this issue 1 year ago • 1 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.

KaranaLJX avatar Sep 19 '23 06:09 KaranaLJX

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

KaranaLJX avatar Sep 19 '23 09:09 KaranaLJX