func addHistory(line string) error { lineCString := C.CString(line) res := C.linenoiseHistoryAdd(lineCString) C.free(unsafe.Pointer(lineCString)) if res != 1 { return errors.New("Could not add line to history.") } return nil }
func HistoryAdd(line string) (done bool) { l := C.CString(line) defer C.free(unsafe.Pointer(l)) i := C.linenoiseHistoryAdd(l) if i == 1 { done = true } else { done = false } return done }