I have a requirement in which I need to store array of objects in a variable. The objects are of different types. Refer to following example:
v := [ {"name":"ravi"},
["art","coding","music","travel"],
{"language":"golang"},
{"experience":"no"}
]
Notice the second element is array of string itself. After research, I thought of storing this as interface type like:
var v interface{} = [ {"name":"ravi"},
["art","coding","music","travel"],
{"language":"golang"},
{"experience":"no"}
]
Still, I am getting few compilation errors which I am not able to find out.