On Mon, Dec 16, 2019 at 8:51 PM <tyeenop...@gmail.com> wrote: > > I am using CGO to call a .so library written by C, and it has a param > unsigned char *result_buffer > > I use a C.uchar to receive its result, but how to convert it a Go string?
You should receive the result in a *C.uchar. You can get a Go string by calling something like C.GoString((*C.char)(unsafe.Pointer(p))). See https://golang.org/cmd/cgo. 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/CAOyqgcWF554MBHVnjpMt6ex_XpM0V%2BfiqoTv6nqe_Nq-3nN0vw%40mail.gmail.com.