If you're looking for a datatype in Go that stores multiple values, that
would be the slice. Slices are ordered collections of data that can change
in size at runtime.
myIntegers := []int{5, 7, 4, 3}
myStrings := []string{"hi", "there"}
myStrings = append(myStrings, "gophers")
The difference
On Tue, Jul 11, 2017 at 9:20 PM, wrote:
>
> A python list can be written as:
>
> ["something", 1234, 56.78, "Another string"]
>
> What is Go's data type that has a similar structure / capability?
The literal answer to your question is
[]interface{}{"something", 1234,
A python list can be written as:
["something", 1234, 56.78, "Another string"]
What is Go's data type that has a similar structure / capability?
Thanks for the help
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this