官术网_书友最值得收藏!

Calling C code from Go

Go allows you to call C code because there are times when the only way to perform some tasks, such as communicating with a hardware device or a database server, is by using C. Nevertheless, if you find yourself using this capability many times in the same project, you might need to reconsider your approach and your choice of programming language.

Talking more about this capability in Go is beyond the scope of this book. What you should remember is that most likely, you will never need to call C code from your Go program. Nevertheless, should you wish to explore this Go feature, you can start by visiting the documentation of the cgo tool at https://golang.org/cmd/cgo/ as well as by looking at the code found at https://github.com/golang/go/blob/master/misc/cgo/gmp/gmp.go.

主站蜘蛛池模板: 张家港市| 亚东县| 和平区| 灌阳县| 珲春市| 北海市| 阜宁县| 太保市| 德江县| 扬州市| 赤壁市| 长子县| 黄龙县| 綦江县| 万全县| 泸溪县| 军事| 兰州市| 蓬莱市| 湛江市| 夏邑县| 阿坝| 黄山市| 齐齐哈尔市| 遵义市| 朔州市| 崇信县| 通榆县| 宁蒗| 绥江县| 日喀则市| 岑巩县| 江都市| 壶关县| 文成县| 舟曲县| 濮阳县| 岑巩县| 湾仔区| 乐陵市| 克拉玛依市|