github.com/cspotcode/docker-cli@v20.10.0-rc1.0.20201201121459-3faad7acc5b8+incompatible/cli-plugins/manager/candidate.go (about) 1 package manager 2 3 import ( 4 "os/exec" 5 ) 6 7 // Candidate represents a possible plugin candidate, for mocking purposes 8 type Candidate interface { 9 Path() string 10 Metadata() ([]byte, error) 11 } 12 13 type candidate struct { 14 path string 15 } 16 17 func (c *candidate) Path() string { 18 return c.path 19 } 20 21 func (c *candidate) Metadata() ([]byte, error) { 22 return exec.Command(c.path, MetadataSubcommandName).Output() 23 }