Golang C 绑定类型设计
Golang C bindings type design
type Foobar C.struct_foobar
对比
type Foobar struct {
foobar C.struct_foobar
}
在为 C 库编写 Golang 绑定时,哪一个有哪些(缺点)优势?
第二个示例清楚地显示了无法从其他包访问的数据结构。
对于第一个,这是不可能的。
type Foobar C.struct_foobar
对比
type Foobar struct {
foobar C.struct_foobar
}
在为 C 库编写 Golang 绑定时,哪一个有哪些(缺点)优势?
第二个示例清楚地显示了无法从其他包访问的数据结构。
对于第一个,这是不可能的。