Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (11 sloc) 239 Bytes
package main
import "C"
var cStringsCache = make(map[string]*C.char)
func cachedCString(str string) *C.char {
if cstr, ok := cStringsCache[str]; ok {
return cstr
cstr := C.CString(str)
cStringsCache[str] = cstr
return cstr
You can’t perform that action at this time.