kubectl get rc,pods should invoke in that order

SplitResourceArguments should not use a golang map
This commit is contained in:
Clayton Coleman 2015-04-17 00:55:26 -04:00
parent 508318afc9
commit 2c11835612

View File

@ -587,8 +587,16 @@ func (b *Builder) Do() *Result {
return r
}
// SplitResourceArgument splits the argument with commas and returns unique
// strings in the original order.
func SplitResourceArgument(arg string) []string {
out := []string{}
set := util.NewStringSet()
set.Insert(strings.Split(arg, ",")...)
return set.List()
for _, s := range strings.Split(arg, ",") {
if set.Has(s) {
continue
}
out = append(out, s)
}
return out
}