summaryrefslogtreecommitdiff
path: root/internal/pkg/all-in-one/handler.go
diff options
context:
space:
mode:
authorMatthieuCoder <matthieu@matthieu-dev.xyz>2023-01-16 12:06:41 +0400
committerMatthieuCoder <matthieu@matthieu-dev.xyz>2023-01-16 12:06:41 +0400
commita5964c91e018acaef22896f1e4357181df838dd2 (patch)
tree6d76171af40a7073f1161d2f7a44213c868e9d39 /internal/pkg/all-in-one/handler.go
parentc599e7cee33f177d7505e553cf948055930a55c0 (diff)
fix go linking
Diffstat (limited to 'internal/pkg/all-in-one/handler.go')
-rw-r--r--internal/pkg/all-in-one/handler.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/pkg/all-in-one/handler.go b/internal/pkg/all-in-one/handler.go
new file mode 100644
index 0000000..b92493e
--- /dev/null
+++ b/internal/pkg/all-in-one/handler.go
@@ -0,0 +1,13 @@
+package allinone
+
+import "C"
+import "unsafe"
+
+//go:linkname goErrorHandler c.goErrorHandler
+//export goErrorHandler
+func goErrorHandler(size C.int, start *C.char) {
+ dest := make([]byte, size)
+ copy(dest, (*(*[1024]byte)(unsafe.Pointer(start)))[:size:size])
+
+ println("Error from all in one runner: %s", string(dest))
+}