From 5215b1eca41e5cd0e22b3bd4e4768c053cba09c5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 23 Apr 2025 12:33:55 +0200 Subject: [PATCH] opts: deprecate ListOpts.GetAll in favor of ListOpts.GetSlice The `GetSlice()` function is part of cobra's [cobra.SliceValue] interface, and duplicates the older `GetAll()` method. This patch deprecates the `GetAll()` method in favor of `GetSlice()`. [cobra.SliceValue]: https://pkg.go.dev/github.com/spf13/cobra@v1.9.1#SliceValue Signed-off-by: Sebastiaan van Stijn --- opts/opts.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opts/opts.go b/opts/opts.go index 0288b2cb59d1..1a885db30eff 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -80,6 +80,8 @@ func (opts *ListOpts) GetMap() map[string]struct{} { } // 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 }