github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/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 }