I'm confused about which variables need to be freed if I'm using C variables in Go.
For example, if I do this:
s := C.CString(`something`)
Is that memory now allocated until I call C.free(unsafe.Pointer(s))
, or is that OK to be garbage collected by Go when the function ends?
Or is it only variables that are created from the imported C code that need to be freed, and these C variables created from the Go code will be garbage collected?