Re: [go-nuts] time.Sleep and sync.WaitGroup strange behavior

2017-01-20 Thread Ian Lance Taylor
On Fri, Jan 20, 2017 at 7:34 PM, Rodolfo Azevedo wrote: > > I have a question, interesting: > > Why the executes is diferente in these both situations? > > Execute A: > > [11:19] > ```package main > > import ( > "fmt" > "sync" > "time" > ) > > var wg sync.WaitGroup > > func A() { > >

[go-nuts] time.Sleep and sync.WaitGroup strange behavior

2017-01-20 Thread Rodolfo Azevedo
Hi all, I have a question, interesting: Why the executes is diferente in these both situations? Execute A: [11:19] ```package main import ( "fmt" "sync" "time" ) var wg sync.WaitGroup func A() { time.Sleep(time.Second * 5) fmt.Println("Função A") wg.Done() } fun