go-node-ffi
go-node-ffi copied to clipboard
Update to support Go 1.16, and Node 14 (LTS)
- Switch JS dependencies to
ffi-napi
,ref-napi
, andref-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 runninggo-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 returningfmt.Sprintf
. This requires further investigation.
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.