Re: [go-nuts] Strange behaviour of Goroutine with time.Sleep on macOS 10.12

2016-07-10 Thread Huy Tr.
Thank you so much! I think I should update my Go. Huy On Sun, Jul 10, 2016 at 7:30 PM Ian Lance Taylor wrote: > On Sun, Jul 10, 2016 at 7:17 PM, Huy Tr. wrote: > > > > But when I run it on macOS 10.12 beta 2, the loop stop updating after > > running for a while. > > https://golang.org/issue/16

Re: [go-nuts] Strange behaviour of Goroutine with time.Sleep on macOS 10.12

2016-07-10 Thread Ian Lance Taylor
On Sun, Jul 10, 2016 at 7:17 PM, Huy Tr. wrote: > > But when I run it on macOS 10.12 beta 2, the loop stop updating after > running for a while. https://golang.org/issue/16272 It's fixed on tip and will be fixed in 1.7 but all earlier Go releases are broken on 10.12. Ian -- You received this

[go-nuts] Strange behaviour of Goroutine with time.Sleep on macOS 10.12

2016-07-10 Thread Huy Tr.
`Hi everybody, I'm playing around with Goroutine and got a strange issue. I tried to run the following code: package main import ( "fmt" "time" ) func loop(c chan int) { i := 0 for { time.Sleep(time.Second / 30) i = i + 1 c <- i } } func main() {