diff options
Diffstat (limited to 'cmd/gotop/main.go')
-rw-r--r-- | cmd/gotop/main.go | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index fc2ac7a..4888f07 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -8,7 +8,6 @@ import ( "os" "os/signal" "path/filepath" - "plugin" "strconv" "strings" "syscall" @@ -463,12 +462,6 @@ func run() int { } ly := layout.ParseLayout(lstream) - err = loadExtensions(conf) - if err != nil { - stderrLogger.Print(err) - return 1 - } - if conf.Test { return runTests(conf) } @@ -546,48 +539,6 @@ func getLayout(conf gotop.Config) (io.Reader, error) { } } -func loadExtensions(conf gotop.Config) error { - var hasError bool - for _, ex := range conf.Extensions { - exf := ex + ".so" - fn := exf - folder := conf.ConfigDir.QueryFolderContainsFile(fn) - if folder == nil { - paths := make([]string, 0) - for _, d := range conf.ConfigDir.QueryFolders(configdir.Existing) { - paths = append(paths, d.Path) - } - log.Printf("unable find extension %s in %s", fn, strings.Join(paths, ", ")) - hasError = true - continue - } - fp := filepath.Join(folder.Path, fn) - p, err := plugin.Open(fp) - if err != nil { - hasError = true - log.Printf(err.Error()) - continue - } - init, err := p.Lookup("Init") - if err != nil { - hasError = true - log.Printf(err.Error()) - continue - } - initFunc, ok := init.(func()) - if !ok { - hasError = true - log.Printf(err.Error()) - continue - } - initFunc() - } - if hasError { - return fmt.Errorf("error initializing plugins") - } - return nil -} - func runTests(conf gotop.Config) int { fmt.Printf("PASS") return 0 |