file:main.go

code :
   package main

func main() {
    a := make(chan int)
    go func() {
        a <- 1
    }()
    println(<-a)
}

go build -o main main.go
gdb main

make(chan int) really exec:
func makechan(t *chantype, size int) *hchan {
    elem := t.elem
...
...
}

go func() really exec
func newproc(siz int32, fn *funcval) {
    argp := add(unsafe.Pointer(&fn), sys.PtrSize)
    gp := getg()
    pc := getcallerpc()
    systemstack(func() {
        newproc1(fn, (*uint8)(argp), siz, gp, pc)
    })
}

So i cann't strace a how to receive 1, who have some good idea?
tks!

-- 
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