Skip to content

Commit a056cc6

Browse files
committed
opts: remove deprecated ListOpts.GetAll
It's no longer used and replaced by `ListOpts.GetSlice`. It was deprecated in 5215b1e Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 15f3e91 commit a056cc6

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

opts/opts.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ func (opts *ListOpts) GetMap() map[string]struct{} {
7979
return ret
8080
}
8181

82-
// GetAll returns the values of slice.
83-
//
84-
// Deprecated: use [ListOpts.GetSlice] instead. This method will be removed in a future release.
85-
func (opts *ListOpts) GetAll() []string {
86-
return *opts.values
87-
}
88-
8982
// GetSlice returns the values of slice.
9083
//
9184
// It implements [cobra.SliceValue] to allow shell completion to be provided

opts/opts_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ func TestMapOpts(t *testing.T) {
112112
}
113113
}
114114

115-
//nolint:gocyclo // ignore "cyclomatic complexity 17 is too high"
116115
func TestListOptsWithoutValidator(t *testing.T) {
117116
o := NewListOpts(nil)
118117
err := o.Set("foo")
@@ -146,9 +145,6 @@ func TestListOptsWithoutValidator(t *testing.T) {
146145
if o.String() != "[bar bar]" {
147146
t.Errorf("%s != [bar bar]", o.String())
148147
}
149-
if listOpts := o.GetAll(); len(listOpts) != 2 || listOpts[0] != "bar" || listOpts[1] != "bar" {
150-
t.Errorf("Expected [[bar bar]], got [%v]", listOpts)
151-
}
152148
if listOpts := o.GetSlice(); len(listOpts) != 2 || listOpts[0] != "bar" || listOpts[1] != "bar" {
153149
t.Errorf("Expected [[bar bar]], got [%v]", listOpts)
154150
}

0 commit comments

Comments
 (0)