【问题标题】:Golang C bindings type design [closed]Golang C 绑定类型设计
【发布时间】:2019-05-26 20:54:34
【问题描述】:
type Foobar C.struct_foobar

对比

type Foobar struct {
    foobar C.struct_foobar
}

在为 C lib 编写 Golang 绑定方面,哪一个有哪些(不利)优势?

【问题讨论】:

    标签: c go binding shared-libraries wrapper


    【解决方案1】:

    第二个示例清楚地显示了其他包无法访问的数据结构。

    如果是第一个,这是不可能的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-06
      • 1970-01-01
      • 1970-01-01
      • 2017-05-12
      • 1970-01-01
      • 2014-01-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多