func FindInPath(plugin string, paths []string) (string, error) {
	if plugin == "" {
		return "", fmt.Errorf("no plugin name provided")
	}
	if len(paths) == 0 {
		return "", fmt.Errorf("no paths provided")
	}
	var fullpath string
	for _, path := range paths {
		full := filepath.Join(path, plugin)
		if fi, err := os.Stat(full); err == nil && fi.Mode().IsRegular() {
			fullpath = full
			break
		}
	}
	if fullpath == "" {
		return "", fmt.Errorf("failed to find plugin %q in path %s", plugin, paths)
	}
	return fullpath, nil
}
FindInPath returns the full path of the plugin by searching in the provided path
package invoke
import (
	"fmt"
	"os"
	"path/filepath"
)