dqpfkzu360216 2018-12-29 10:07
浏览 112
已采纳

Golang C绑定类型设计

type Foobar C.struct_foobar

vs.

type Foobar struct {
    foobar C.struct_foobar
}

Which one has which (dis)advantages for writing Golang bindings for a C lib?

  • 写回答

1条回答 默认 最新

  • dongpo5239 2018-12-29 17:41
    关注

    The second example clearly shows a data structure not accessible from other packages.

    With the first one this would be impossible.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?