Closed liamsi closed 3 years ago
As far as I understand, go plugins need to be defined in a main package to work properly (-buildmode=plugin requires exactly one main package).
That's the approach we took in #144: https://github.com/lazyledger/lazyledger-core/blob/dbd2daf493669489abd16e94c315596d6504c667/p2p/ipld/plugin/plugin.go#L1
It seems possible to load the plugin using loader.Preload though: https://github.com/ipfs/go-ipfs/blob/7588a6a52a789fa951e1c4916cee5c7a304912c2/plugin/loader/loader.go#L28
loader.Preload
That would only work if the Plugin was in an importable lib/package (not main). Ideally, both would be possible.
This was tackled in #155
As far as I understand, go plugins need to be defined in a main package to work properly (-buildmode=plugin requires exactly one main package).
That's the approach we took in #144: https://github.com/lazyledger/lazyledger-core/blob/dbd2daf493669489abd16e94c315596d6504c667/p2p/ipld/plugin/plugin.go#L1
It seems possible to load the plugin using
loader.Preload
though: https://github.com/ipfs/go-ipfs/blob/7588a6a52a789fa951e1c4916cee5c7a304912c2/plugin/loader/loader.go#L28That would only work if the Plugin was in an importable lib/package (not main). Ideally, both would be possible.