On Wed, Apr 24, 2019 at 10:47 AM Nitish Saboo <nitish.sabo...@gmail.com> wrote:

> ./main.go:80:32: cannot use key (type *_Ctype_char) as type string in map 
> index

func CallBack(ckey *C.char, value *C.char, value_len C.size_t){
    key := C.GoString(ckey)
    if remap, ok := field_mappings[key]; ok {
        fmt.Println(key, remap)
    }
}


> ./main.go:91:21: cannot use CallBack (type func(*_Ctype_char, *_Ctype_char, 
> _Ctype_ulong)) as type *[0]byte in argument to _Cfunc_reload_pattern_db
> ./main.go:143:21: cannot use CallBack (type func(*_Ctype_char, *_Ctype_char, 
> _Ctype_ulong)) as type *[0]byte in argument to

See https://github.com/golang/go/wiki/cgo#function-variables:

        "Because of the pointer passing rules Go code can not pass a
function value directly to C. "

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