In ruby I can created array is filled with types:
[1, 'hello', :world] # [Fixnum, String, Symbol]
=> [1, "hello", :here]
How to implement a similar array is filled with mixed types in Go?
How to declare the array?
You can do that via the empty interface - interface{}
:
arr := make([]interface{}, 0)
arr = append(arr, "asdfs")
arr = append(arr, 5)
or in literal form:
arr := []interface{}{"asdfs", 5}
Whenever you want to use a value of that array you need to use a type assertion.