rust2go icon indicating copy to clipboard operation
rust2go copied to clipboard

When is GODEBUG=invalidptr=0,cgocheck=0 needed

Open cheesycod opened this issue 5 months ago • 0 comments

I'm just curious as to when GODEBUG=invalidptr=0,cgocheck=0 is required.

For example, would the below break (this is what I currently need as my usecase is converting legacy file format that relies on Go-specific string interning extensions on msgpack to a simpler format that isn't Go-specific in a Rust service):

pub mod binding {
    #![allow(warnings)]
    rust2go::r2g_include_binding!();
}

#[derive(rust2go::R2G)]
pub struct Request {
    pub data: Vec<u8>, // Bytes of the file to convert
    pub password: String,
}

#[derive(rust2go::R2G)]
pub struct Response {
    pub data: Vec<u8>, // Output
    pub err: String,
}

#[rust2go::r2g]
pub trait Call {
    fn convert(req: &Request) -> Response;
}

cheesycod avatar Aug 08 '25 17:08 cheesycod