Beispiel #1
0
func godb_ignore() {
	log.Printf(fmt.Sprintf("", errors.New("")))
	temp := unsafe.Pointer(&struct{}{})
	log.Printf("% v", temp)
	result := C.temp(10)
	log.Printf("Result: %d ", result)

}
Beispiel #2
0
func Stuff(value int) (int, error) {
	result := C.temp(C.int(value))
	log.Printf("Result: %d ", result)

	str := C.CString("/go/datafile.godb")
	//str := C.CString("/datafile.godb")
	defer C.free(unsafe.Pointer(str))
	var handle C.int
	handle, err := C.godb_open_file(str, 0666)
	if err != nil {
		log.Printf("Error opening file: %s", err)
		return int(handle), err
	}
	//defer C.free(unsafe.Pointer(handle))
	log.Printf("File handle: %d", handle)

	return int(handle), nil
}