7 // Discover discovers plugins that are in a given directory.
9 // The directory doesn't need to be absolute. For example, "." will work fine.
11 // This currently assumes any file matching the glob is a plugin.
12 // In the future this may be smarter about checking that a file is
13 // executable and so on.
16 func Discover(glob, dir string) ([]string, error) {
19 // Make the directory absolute if it isn't already
20 if !filepath.IsAbs(dir) {
21 dir, err = filepath.Abs(dir)
27 return filepath.Glob(filepath.Join(dir, glob))