.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.1-0.20210319172145-bda8f5cee399 / internal / lsp / testdata / cgo / declarecgo.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399/internal/lsp/testdata/cgo/declarecgo.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399/internal/lsp/testdata/cgo/declarecgo.go
new file mode 100644 (file)
index 0000000..c283cdf
--- /dev/null
@@ -0,0 +1,27 @@
+package cgo
+
+/*
+#include <stdio.h>
+#include <stdlib.h>
+
+void myprint(char* s) {
+       printf("%s\n", s);
+}
+*/
+import "C"
+
+import (
+       "fmt"
+       "unsafe"
+)
+
+func Example() { //@mark(funccgoexample, "Example"),item(funccgoexample, "Example", "func()", "func")
+       fmt.Println()
+       cs := C.CString("Hello from stdio\n")
+       C.myprint(cs)
+       C.free(unsafe.Pointer(cs))
+}
+
+func _() {
+       Example() //@godef("ample", funccgoexample),complete("ample", funccgoexample)
+}