diff --git a/src/go/rpk/pkg/adminapi/api_broker.go b/src/go/rpk/pkg/adminapi/api_broker.go index e5e54aa1234d2..f1340eb422357 100644 --- a/src/go/rpk/pkg/adminapi/api_broker.go +++ b/src/go/rpk/pkg/adminapi/api_broker.go @@ -87,7 +87,7 @@ type DecommissionStatusResponse struct { func (a *AdminAPI) Brokers(ctx context.Context) ([]Broker, error) { var bs []Broker defer func() { - sort.Slice(bs, func(i, j int) bool { return bs[i].NodeID < bs[j].NodeID }) //nolint:revive // return inside this deferred function is for the sort's less function + sort.Slice(bs, func(i, j int) bool { return bs[i].NodeID < bs[j].NodeID }) }() return bs, a.sendAny(ctx, http.MethodGet, brokersEndpoint, nil, &bs) }