From 1441f90e5a4032c7419e252cc12c6e406d996ed3 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 9 Sep 2025 03:16:43 -0500 Subject: smarter init() --- plugin.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'plugin.go') diff --git a/plugin.go b/plugin.go index e07d046..3f23223 100644 --- a/plugin.go +++ b/plugin.go @@ -255,21 +255,13 @@ func searchPaths(name string) *aplug { // load module // 1. open the shared object file to load the symbols func initToolkit(name string, filename string) *aplug { - /* - if _, err := os.Stat(filename); err != nil { - if os.IsNotExist(err) { - log.Log(PLUG, "initToolkit() missing plugin", name, "as filename", filename) - return nil - } - } - log.Log(PLUG, "initToolkit() Found plugin", name, "as filename", filename) - - plug, err := plugin.Open(filename) - */ + // smart plugin test. remove all other code besides this if err := checkPluginViaSubprocess(filename); err != nil { log.Printf("initToolkit() subprocess load plugin failed: %v\n", err) return nil } + // the plugin will probably work. show the banner + colorBanner() plug, err := checkPlug(filename) if err != nil { -- cgit v1.2.3