Dependency from C

When using CGO, you face the same problem that other languages face when creating bindings or wrappers to C code. You are completely dependent on it. 

The Go application has to handle the way C uses memory and other resources, while the C application is not aware of what Go is doing and is not using any kind of concurrency, neither goroutines nor threads.

In addition to that, C code is hard to debug, maintain, and replace if you're not a C developer. This way, sometimes it is better to write a library from the ground up, instead of relying on the existing C implementation.

A very good example of this is go-git (https://github.com/src-d/go-git), which implements the Git protocol functionality in pure Go by imitating the existing C library, libgit2.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.80.3