Copy dependencies into vendor dir, using dep

This commit is contained in:
Bryan Boreham committed 2018-04-27 14:34:48 +01:00
1 parent 549ccff5eb
commit b534ea60f5
2857 files changed
+945317

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
package mflagext
import (
"fmt"
"github.com/weaveworks/common/mflag"
)
type listOpts struct {
value *[]string
hasBeenSet bool
}
// ListVar creates an mflag.Var for repeated flags.
func ListVar(p *[]string, names []string, value []string, usage string) {
*p = value
mflag.Var(&listOpts{p, false}, names, usage)
}
// Set implements mflag.Var
func (opts *listOpts) Set(value string) error {
if opts.hasBeenSet {
(*opts.value) = append((*opts.value), value)
} else {
(*opts.value) = []string{value}
opts.hasBeenSet = true
}
return nil
}
// String implements mflag.Var
func (opts *listOpts) String() string {
return fmt.Sprintf("%v", []string(*opts.value))
}