Re: [go-nuts] What is Go's version of python's list data type?

2017-07-12 Thread Tyler Compton
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

Re: [go-nuts] What is Go's version of python's list data type?

2017-07-11 Thread Ian Lance Taylor
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,

[go-nuts] What is Go's version of python's list data type?

2017-07-11 Thread andy . army91
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