Skip to content

Commit

Permalink
Move NAPI_MODULE call to separate file for Node 18+ compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
drakedevel committed Dec 26, 2023
1 parent bdb72e5 commit a4f9e3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 0 additions & 4 deletions internal/napi/init.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package napi

// #cgo linux LDFLAGS: -Wl,--unresolved-symbols=ignore-all
// #cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup
// #include <node_api.h>
// napi_value napiModuleInit(napi_env env, napi_value exports);
// NAPI_MODULE(go_text_template_napi_binding, napiModuleInit)
import "C"

var registeredInitFunc func(env Env, exports Value) (Value, error)
Expand Down
8 changes: 8 additions & 0 deletions internal/napi/napi_module.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package napi

// #cgo linux LDFLAGS: -Wl,--unresolved-symbols=ignore-all
// #cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup
// #include <node_api.h>
// napi_value napiModuleInit(napi_env env, napi_value exports);
// NAPI_MODULE(go_text_template_napi_binding, napiModuleInit)
import "C"

0 comments on commit a4f9e3d

Please sign in to comment.