[go-nuts] concurrency programing about go

2017-10-29 Thread Dave Cheney
Hello. I’m guessing that your tried calling twoprint(), but you’ve probably found that nothing is printed to the screen before your program exits. Is that correct? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group a

[go-nuts] concurrency programing about go

2017-10-29 Thread 2891132love
I write some function and other things in the followings: var a string var once sync.Once func setup() { a = "hello,world" } func doprint() { once.Do(setup) fmt.Print(a) } func twoprint() { go doprint() go doprint() } the quwstion is how can I make use of function twoprint()?? Thank you