You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin package in Go declares a simple mechanism for loading Go plugins.
A package is compiled with the command go build -buildmode=plugin
A plugin file is produced (on Linux this is a shared library)
At runtime, a program can load a plugin and all exported symbols.
// Open opens a Go plugin.// If a path has already been opened, then the existing *Plugin is returned.// It is safe for concurrent use by multiple goroutines.funcOpen(pathstring) (*Plugin, error) {
// GopherJS: load the plugin from the .js file using module.exports.
}
// Lookup searches for a symbol named symName in plugin p.// A symbol is any exported variable or function.// It reports an error if the symbol is not found.// It is safe for concurrent use by multiple goroutines.func (p*Plugin) Lookup(symNamestring) (Symbol, error) {
// GopherJS: lookup the symbol using the lookup table.
}
The
plugin
package in Go declares a simple mechanism for loading Go plugins.go build -buildmode=plugin
Docs: https://golang.org/pkg/plugin/
There are then two components that could be implemented for GopherJS:
Would this be feasible to implement in GopherJS?
Related:
The text was updated successfully, but these errors were encountered: