go-node-ffi icon indicating copy to clipboard operation
go-node-ffi copied to clipboard

Update to support Go 1.16, and Node 14 (LTS)

Open MrSaints opened this issue 3 years ago • 1 comments

  • Switch JS dependencies to ffi-napi, ref-napi, and ref-struct-di, as the previous dependencies are no longer maintained, and they do not support Node 14.
  • Re-build shared library using Go 1.16.4.
  • Set GODEBUG=cgocheck=0 when running go-node-ffi.js to get around "cgo result has Go pointer" / "Go pointer stored into non-Go memory". This may very well be a legitimate error / check, and if so, it is caused by using, and returning fmt.Sprintf. This requires further investigation.

MrSaints avatar May 10 '21 14:05 MrSaints

So reading the docs again, really, we shouldn't be returning GoString. This does add a bit of complexity as the caller will have to free the string right after use.

MrSaints avatar May 10 '21 15:05 MrSaints