mirror of https://github.com/docker/cli.git
opts: remove deprecated ListOpts.GetAll
It's no longer used and replaced by `ListOpts.GetSlice`. It was deprecated
in 5215b1eca4
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
15f3e910d1
commit
a056cc6164
|
|
@ -79,13 +79,6 @@ func (opts *ListOpts) GetMap() map[string]struct{} {
|
|||
return ret
|
||||
}
|
||||
|
||||
// GetAll returns the values of slice.
|
||||
//
|
||||
// Deprecated: use [ListOpts.GetSlice] instead. This method will be removed in a future release.
|
||||
func (opts *ListOpts) GetAll() []string {
|
||||
return *opts.values
|
||||
}
|
||||
|
||||
// GetSlice returns the values of slice.
|
||||
//
|
||||
// It implements [cobra.SliceValue] to allow shell completion to be provided
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ func TestMapOpts(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
//nolint:gocyclo // ignore "cyclomatic complexity 17 is too high"
|
||||
func TestListOptsWithoutValidator(t *testing.T) {
|
||||
o := NewListOpts(nil)
|
||||
err := o.Set("foo")
|
||||
|
|
@ -146,9 +145,6 @@ func TestListOptsWithoutValidator(t *testing.T) {
|
|||
if o.String() != "[bar bar]" {
|
||||
t.Errorf("%s != [bar bar]", o.String())
|
||||
}
|
||||
if listOpts := o.GetAll(); len(listOpts) != 2 || listOpts[0] != "bar" || listOpts[1] != "bar" {
|
||||
t.Errorf("Expected [[bar bar]], got [%v]", listOpts)
|
||||
}
|
||||
if listOpts := o.GetSlice(); len(listOpts) != 2 || listOpts[0] != "bar" || listOpts[1] != "bar" {
|
||||
t.Errorf("Expected [[bar bar]], got [%v]", listOpts)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue