rav*_*avi 7 arrays variable-assignment go
我有一个要求,我需要在变量中存储对象数组.对象是不同类型的.请参阅以下示例:
v := [ {"name":"ravi"},
["art","coding","music","travel"],
{"language":"golang"},
{"experience":"no"}
]
注意第二个元素是字符串本身的数组.经过研究,我想把它存储为接口类型,如:
var v interface{} = [ {"name":"ravi"},
["art","coding","music","travel"],
{"language":"golang"},
{"experience":"no"}
]
不过,我收到的编译错误很少,我无法找到.