Skip to content

Commit 5215b1e

Browse files
committed
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 <github@gone.nl>
1 parent ca19957 commit 5215b1e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

opts/opts.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ func (opts *ListOpts) GetMap() map[string]struct{} {
8080
}
8181

8282
// GetAll returns the values of slice.
83+
//
84+
// Deprecated: use [ListOpts.GetSlice] instead. This method will be removed in a future release.
8385
func (opts *ListOpts) GetAll() []string {
8486
return *opts.values
8587
}

0 commit comments

Comments
 (0)