I want to wrap a C function that takes a char* pointing to (the first element of) a non-empty buffer of bytes. I\'m trying to wrap that in a Go function using CGo s
char*
Ok, that turned out to be much easier than I thought:
(*C.char)(unsafe.Pointer(&b[0]))
does the trick. (Found this at golang-nuts.)