summaryrefslogtreecommitdiff
path: root/internal/pkg/all-in-one/all-in-one.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg/all-in-one/all-in-one.go')
-rw-r--r--internal/pkg/all-in-one/all-in-one.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/internal/pkg/all-in-one/all-in-one.go b/internal/pkg/all-in-one/all-in-one.go
index 76c11f2..b95d515 100644
--- a/internal/pkg/all-in-one/all-in-one.go
+++ b/internal/pkg/all-in-one/all-in-one.go
@@ -9,7 +9,6 @@ import "C"
import (
"fmt"
"time"
- "unsafe"
"github.com/Jeffail/gabs"
"github.com/alicebob/miniredis/v2"
@@ -22,14 +21,6 @@ type AllInOne struct {
instance *C.AllInOneInstance
}
-//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))
-}
-
func NewAllInOne() (*AllInOne, error) {
redis := miniredis.NewMiniRedis()
nats, err := server.NewServer(&server.Options{})
@@ -55,6 +46,7 @@ func (s *AllInOne) Start() error {
if !s.nats.ReadyForConnections(5 * time.Second) {
return fmt.Errorf("nats server didn't start after 5 seconds, please check if there is another service listening on the same port as nats")
}
+
handler := C.ErrorHandler(C.allInOneErrorHandler)
// Set the error handler
C.set_error_handler(handler)