From 219325195c0b784aefc0ee2fec3d7031d084ba75 Mon Sep 17 00:00:00 2001 From: James Mills <1290234+prologic@users.noreply.github.com> Date: Tue, 24 Dec 2019 09:33:44 +1000 Subject: [PATCH] Fix type error and add Go111Modules support --- go.mod | 3 +++ ultralight.go | 17 +++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1a09b6f --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/raff/ultralight-go + +go 1.13 diff --git a/ultralight.go b/ultralight.go index 228d80e..afdaf12 100644 --- a/ultralight.go +++ b/ultralight.go @@ -118,13 +118,14 @@ static inline JSObjectRef make_function_callback(JSContextRef ctx, JSStringRef n } */ import "C" -import "unsafe" -import "unicode/utf16" -import "unicode/utf8" -import "reflect" -import "bytes" - -import "log" +import ( + "bytes" + "log" + "reflect" + "unicode/utf16" + "unicode/utf8" + "unsafe" +) type JSType int @@ -315,7 +316,7 @@ func decodeJSString(s C.JSStringRef) string { // // Note: You should only create one of these per application lifetime. func NewApp() *App { - return &App{app: C.ulCreateApp(C.ulCreateConfig()), windows: map[C.ULWindow]*Window{}} + return &App{app: C.ulCreateApp(C.ulCreateSettings(), C.ulCreateConfig()), windows: map[C.ULWindow]*Window{}} } // Destroy destroys the App instance.