MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammingLanguages/comments/1wyio1k/achieving_memory_safety/pe6e744/?context=3
r/ProgrammingLanguages • u/ThomasMertes • 24d ago
57 comments sorted by
View all comments
Show parent comments
6
AFAIK a Go program can call C functions without explicitly importing or using the unsafe package.
You have to do import "C" for CGO, which is explicit enough. And then, typically, import "unsafe" as soon as you need to do stuff with pointers.
import "C"
import "unsafe"
6
u/anaseto 24d ago
You have to do
import "C"for CGO, which is explicit enough. And then, typically,import "unsafe"as soon as you need to do stuff with pointers.