I'm trying to execute an example from golang.org : http://tour.golang.org/#63
- I Have Changed The Code To Test What Exactly Gosched does.*
You could see the output there is:
hello
hello
hello
hello
hello
But when i copy those code to my Mac OS X 10.8(Go version 1.0.3), the output has changed:
xxxxxx$ go version
go version go1.0.3
xxxxxx$ go run goroutine.go
hello
world
hello
world
hello
world
hello
world
hello
world
According to this answer, i should use runtime.GoSched, but in fact i needn't.So i believe something goes wrong.
Please help me with this, many thanks.