github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/cli-plugins/manager/candidate.go (about)

     1  package manager
     2  
     3  import "os/exec"
     4  
     5  // Candidate represents a possible plugin candidate, for mocking purposes
     6  type Candidate interface {
     7  	Path() string
     8  	Metadata() ([]byte, error)
     9  }
    10  
    11  type candidate struct {
    12  	path string
    13  }
    14  
    15  func (c *candidate) Path() string {
    16  	return c.path
    17  }
    18  
    19  func (c *candidate) Metadata() ([]byte, error) {
    20  	return exec.Command(c.path, MetadataSubcommandName).Output()
    21  }