From a056cc61644c2b388ed4071603c75c966dfb3e0a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 18 Aug 2025 18:43:13 +0200 Subject: [PATCH] opts: remove deprecated ListOpts.GetAll It's no longer used and replaced by `ListOpts.GetSlice`. It was deprecated in 5215b1eca41e5cd0e22b3bd4e4768c053cba09c5 Signed-off-by: Sebastiaan van Stijn --- opts/opts.go | 7 ------- opts/opts_test.go | 4 ---- 2 files changed, 11 deletions(-) diff --git a/opts/opts.go b/opts/opts.go index e7a97a573e..472188d8bc 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -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 diff --git a/opts/opts_test.go b/opts/opts_test.go index 7dc87cad9e..c5908e8f15 100644 --- a/opts/opts_test.go +++ b/opts/opts_test.go @@ -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) }