增加 Example.
Signed-off-by: rick.chan <chenyang@autoai.com>
This commit is contained in:
parent
fe4f04ba13
commit
e31607662b
|
@ -2,7 +2,7 @@
|
|||
|
||||
CGO is an official builtin feature of Go, it enables the creation of Go packages that reference to C libraries. But it isn’t just that, it is achievable in the opposite direction, too. It enables creation of C libraries from Go packages so that C code can reference to Go, which is mind-blowing.
|
||||
|
||||
CGO 不但可以使 Go 包访问 C 库,还可以通过 Go 包创建 C 库。
|
||||
CGO 不但可以使 Go 包访问 C 库,还可以通过 Go 包创建 C 库,进而使 C/C++ 程序可调用 Go 语言程序。
|
||||
|
||||
## 1.How to
|
||||
|
||||
|
@ -40,6 +40,8 @@ To export a Go function as a C symbol:
|
|||
* 在要导出的函数使用 **//export FuncName** 注释;
|
||||
* 不能使用 Go struct、Go interface、Go arra、以及可变参数。
|
||||
|
||||
## 2.Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
|
|
Loading…
Reference in New Issue