diff --git a/lib/flagutil/array.go b/lib/flagutil/array.go deleted file mode 100644 index d8b55c2fe..000000000 --- a/lib/flagutil/array.go +++ /dev/null @@ -1,18 +0,0 @@ -package flagutil - -import "strings" - -// Array holds an array of flag values -type Array []string - -// String implements flag.Value interface -func (a *Array) String() string { - return strings.Join(*a, ",") -} - -// Set implements flag.Value interface -func (a *Array) Set(value string) error { - values := strings.Split(value, ",") - *a = append(*a, values...) - return nil -} diff --git a/lib/flagutil/array_test.go b/lib/flagutil/array_test.go deleted file mode 100644 index 835d9cfa5..000000000 --- a/lib/flagutil/array_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package flagutil - -import ( - "flag" - "os" - "testing" -) - -var fooFlag Array - -func init() { - os.Args = append(os.Args, "--fooFlag=foo", "--fooFlag=bar") - flag.Var(&fooFlag, "fooFlag", "test") -} - -func TestMain(m *testing.M) { - flag.Parse() - os.Exit(m.Run()) -} - -func TestArray(t *testing.T) { - expected := map[string]struct{}{ - "foo": {}, - "bar": {}, - } - if len(expected) != len(fooFlag) { - t.Errorf("len array flag (%d) is not equal to %d", len(fooFlag), len(expected)) - } - for _, i := range fooFlag { - if _, ok := expected[i]; !ok { - t.Errorf("unexpected item in array %v", i) - } - } -}