Last Updated: May 22, 2026
CGO lets a Go program call functions written in C and, going the other way, lets C call back into Go. This chapter focuses on the type system at the boundary, how strings and structs cross it, the rules around memory ownership, and how callbacks via //export actually flow.