How Build go c-shared library dll with callbacks?

Hi!
i tries create a library(dll) with go, and receive functions from other languaje to use as callbacks

package main

import "C"
import "fmt"

type externFunc func(int)

//export Connect
func Connect(callback externFunc) {
    fmt.Println("cb ",callback)

    for i:= 0; i<3;i++{

       // this is the func/method received from c#, and tried execute from golang
       callback(i)
    }
}

and this is the error apears when run my application

Error
unexpected fault address 0xffffffffffffffff
fatal error: fault
[signal 0xc0000005 code=0x0 addr=0xffffffffffffffff pc=0x627ca9ab]

what is the way to receive callbacks?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.