From c7cb475db78bf6daa4e50acd684a6f0b7b12956a Mon Sep 17 00:00:00 2001 From: Ben Clive Date: Thu, 26 Sep 2024 15:51:47 +0100 Subject: [PATCH] lint --- pkg/ingester/recalculate_owned_streams.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/ingester/recalculate_owned_streams.go b/pkg/ingester/recalculate_owned_streams.go index 5813cc58e45e7..b1f6bd62ebfc7 100644 --- a/pkg/ingester/recalculate_owned_streams.go +++ b/pkg/ingester/recalculate_owned_streams.go @@ -124,14 +124,15 @@ func (s *ownedStreamsIngesterStrategy) checkRingForChanges() (bool, error) { return ringChanged, nil } +//nolint:staticcheck func (s *ownedStreamsIngesterStrategy) isOwnedStream(str *stream) (bool, error) { descsBuf := s.descsBufPool.Get().([]ring.InstanceDesc) hostsBuf := s.hostsBufPool.Get().([]string) zoneBuf := s.zoneBufPool.Get().([]string) defer func() { - s.descsBufPool.Put(&descsBuf) - s.hostsBufPool.Put(&hostsBuf) - s.zoneBufPool.Put(&zoneBuf) + s.descsBufPool.Put(descsBuf[:0]) + s.hostsBufPool.Put(hostsBuf[:0]) + s.zoneBufPool.Put(zoneBuf[:0]) }() replicationSet, err := s.ingestersRing.Get(lokiring.TokenFor(str.tenant, str.labelsString), ring.WriteNoExtend, descsBuf, hostsBuf, zoneBuf)