Skip to content

Commit

Permalink
fix(go): correct field name for C struct (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
sammyne committed May 29, 2024
1 parent 9b50b8e commit e8cd824
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/go/src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,8 @@ impl<'a, 'b> FunctionBindgen<'a, 'b> {
}

pub(crate) fn get_c_field_name(&mut self, field: &Field) -> String {
avoid_keyword(field.name.to_snake_case().as_str())
let name = wit_bindgen_c::to_c_ident(field.name.to_snake_case().as_str());
avoid_keyword(&name)
}

pub(crate) fn get_go_field_name(&mut self, field: &Field) -> String {
Expand Down

0 comments on commit e8cd824

Please sign in to comment.