I defined a struct
type container struct{
Data []interface{}
}
and was hoping to assign slice of all different kinds of data types to it. For example
ints := []int{2,3,4}
tmp := container{ints}
However, the compiler complains:
cannot use ints (type []int) as type []interface {} in field value
How should I define the container struct? Or the assignment needs to be done differently?
A complete example can be found here