On Wed, Apr 25, 2018 at 2:27 AM,  <threebears...@gmail.com> wrote:
>
> So it always guarantees to print "hello world" for the unbuffered channel,
> doesn't it?
>
> package main
> var c = make(chan int)
> var a string
>
> func f() {
>      a = "hello, world"
>      c <- 0
> }
>
> func main() {
>      go f()
>      <-c
>      print(a)
> }
> it will guarantee to print "hello, world".
>
> package main
> var c = make(chan int)
> var a string
>
> func f() {
>      a = "hello, world"
>       <-c
> }
>
> func main() {
>      go f()
>      c <- 0
>      print(a)
> }
> it will also guarantee to print "hello, world".


Yes.

Ian

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to