Grokking Advanced Go
0% completed
cgo Basics
"Cgo is not Go." This is one of the Go proverbs that Rob Pike presented.
The tool cgo lets a Go package call C code. The Go code keeps its usual syntax, but the package now depends on a C compiler, on memory that the garbage collector does not manage, and on calls that cost more than Go calls. A crash inside C also ends the whole program.
What does each of those costs look like in practice, and when is it better to avoid cgo? The course player does not run cgo programs. All the output below was captured on one Windows machine with amd64 and GCC, so timings on Linux will differ.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%