On Thu, Feb 18, 2021, 12:21 PM Juliusz Chroboczek <j...@irif.fr> wrote:

> > For example, on the Go side write
>
> > type chanToUse struct {
> >     c chan int
> > }
>
> > //export MyGoFunction
> > func MyGoFunction(u unsafe.Pointer, val int) {
> >     cu = (*chanToUse)(u)
> >     cu.c <- val
> > }
>
> Why the struct?  Couldn't you just pass a pointer to a chan?
>

Sure, that should work too.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWvSZg3d08-C-%2BDHqY3wWjOFKEehE2ojgpHFAjQfmggug%40mail.gmail.com.

Reply via email to