Re: [go-nuts] Nondeterministic Behavior of for Loop Ranging Over a map

2020-05-26 Thread Kaveh Shahbazian
Thank you, I didn't know about this attack (of-course I need to spend some time to understand it). -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+un

Re: [go-nuts] Nondeterministic Behavior of for Loop Ranging Over a map

2020-05-26 Thread 'Dan Kortschak' via golang-nuts
On Tue, 2020-05-26 at 16:26 +1000, Jesse McNelis wrote: > On Tue, May 26, 2020 at 3:37 PM Paul Jolly wrote: > > > Why the output of this code is nondeterministic? > > > > See https://golang.org/ref/spec#For_statements, specifically the > > "For > > statements with range clause" subheading, specif

Re: [go-nuts] Nondeterministic Behavior of for Loop Ranging Over a map

2020-05-25 Thread Kaveh Shahbazian
I was already familiar with the behavior of ordering. The part that was new for me, was the missing map entries. Which of-course was documented - provided by Paul. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group a

Re: [go-nuts] Nondeterministic Behavior of for Loop Ranging Over a map

2020-05-25 Thread Jesse McNelis
On Tue, May 26, 2020 at 3:37 PM Paul Jolly wrote: > > Why the output of this code is nondeterministic? > > See https://golang.org/ref/spec#For_statements, specifically the "For > statements with range clause" subheading, specifically this bullet: > > > 3. The iteration order over maps is not spec

Re: [go-nuts] Nondeterministic Behavior of for Loop Ranging Over a map

2020-05-25 Thread Kaveh Shahbazian
Thank you Paul, On Tuesday, May 26, 2020 at 7:37:34 AM UTC+2, Paul Jolly wrote: > > > Why the output of this code is nondeterministic? > > See https://golang.org/ref/spec#For_statements, specifically the "For > statements with range clause" subheading, specifically this bullet: > > > 3. The ite

Re: [go-nuts] Nondeterministic Behavior of for Loop Ranging Over a map

2020-05-25 Thread Paul Jolly
> Why the output of this code is nondeterministic? See https://golang.org/ref/spec#For_statements, specifically the "For statements with range clause" subheading, specifically this bullet: > 3. The iteration order over maps is not specified and is not guaranteed to be > the same from one iterati

[go-nuts] Nondeterministic Behavior of for Loop Ranging Over a map

2020-05-25 Thread Kaveh Shahbazian
Why the output of this code is nondeterministic? Go Playground package main import ( "fmt" ) func main() { series := make(map[int]int) series[0] = 0 i := 1 for k, v := range series { fmt.Println(k, v) if i < 10 {