I want to use cgo. On the C side I have struct containing 32 bytes.
struct hash {
uint8_t bytes[32];
};
On the Go size I have very similar type.
type Hash [32]bytes
I would like to call a C function void f(struct hash)
with an instance of Hash
type. If possible I would also like to avoid a copy of the value.
Simple assignment Chash C.struct_hash := hash
does not work:
cannot use hash (type Hash) as type C.struct_hash in assignment