From a91fb873e42c5777b1fe772b54accfa49c3ee5fc Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Mon, 24 Oct 2022 22:03:08 +0200 Subject: [PATCH] fix incorrect use of sort.StringSlice A newer version of staticheck found these: > SA4029: sort.StringSlice is a type, not a function, and > sort.StringSlice(variants) doesn't sort your values; consider using > sort.Strings instead (staticcheck) --- client/zfsabstractions.go | 2 +- endpoint/endpoint_zfs_abstraction.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/zfsabstractions.go b/client/zfsabstractions.go index cda3f46..c747286 100644 --- a/client/zfsabstractions.go +++ b/client/zfsabstractions.go @@ -57,7 +57,7 @@ func (f *zabsFilterFlags) registerZabsFilterFlags(s *pflag.FlagSet, verb string) for v := range endpoint.AbstractionTypesAll { variants = append(variants, string(v)) } - variants = sort.StringSlice(variants) + sort.Strings(variants) variantsJoined := strings.Join(variants, "|") s.Var(&f.Types, "type", fmt.Sprintf("only %s holds of the specified type [default: all] [comma-separated list of %s]", verb, variantsJoined)) diff --git a/endpoint/endpoint_zfs_abstraction.go b/endpoint/endpoint_zfs_abstraction.go index c8682bb..a3a6981 100644 --- a/endpoint/endpoint_zfs_abstraction.go +++ b/endpoint/endpoint_zfs_abstraction.go @@ -168,7 +168,7 @@ func (s AbstractionTypeSet) String() string { for i := range s { sts = append(sts, string(i)) } - sts = sort.StringSlice(sts) + sort.Strings(sts) return strings.Join(sts, ",") }