mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-23 13:39:12 +00:00
21 lines
388 B
Go
21 lines
388 B
Go
|
package main;
|
||
|
|
||
|
|
||
|
|
||
|
/*
|
||
|
#cgo LDFLAGS: -L./lib -framework Security -lloro
|
||
|
#include "./lib/loro_ffi.h"
|
||
|
*/
|
||
|
import "C"
|
||
|
import "fmt"
|
||
|
|
||
|
func main() {
|
||
|
loro := C.loro_new();
|
||
|
text := C.loro_get_text(loro, C.CString("text"));
|
||
|
pos := C.uint(0);
|
||
|
C.text_insert(text, loro, &pos, C.CString("abc"));
|
||
|
value := C.text_value(text);
|
||
|
fmt.Println(C.GoString(value));
|
||
|
C.text_free(text);
|
||
|
C.loro_free(loro);
|
||
|
}
|