func mount(dir string, options string) (int, error) { errp := (**C.char)(C.malloc(16)) *errp = nil defer C.free(unsafe.Pointer(errp)) cdir := C.CString(dir) defer C.free(unsafe.Pointer(cdir)) fd := C.mountfuse(cdir, errp) if *errp != nil { return -1, mountError(C.GoString(*errp)) } return int(fd), nil }
func mount(dir string) (int, string) { errp := (**C.char)(C.malloc(16)) *errp = nil defer C.free(unsafe.Pointer(errp)) cdir := C.CString(dir) defer C.free(unsafe.Pointer(cdir)) fd := C.mountfuse(cdir, errp) var err string if *errp != nil { err = C.GoString(*errp) } return int(fd), err }