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

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.

主站蜘蛛池模板: 鹰潭市| 米林县| 德州市| 卓资县| 紫金县| 巴东县| 微山县| 高淳县| 常熟市| 永平县| 义马市| 静乐县| 翁源县| 农安县| 宾川县| 阳城县| 临泽县| 永城市| 三穗县| 兴和县| 信阳市| 勐海县| 承德县| 天门市| 临沧市| 汪清县| 神农架林区| 通渭县| 伽师县| 舟曲县| 镇原县| 汉中市| 阿图什市| 微山县| 永善县| 临泽县| 龙里县| 胶南市| 德州市| 调兵山市| 山阴县|