From 13d446f194c41e45f3c60d4d4c914bf7e6061a93 Mon Sep 17 00:00:00 2001 From: Cyrille Nofficial Date: Tue, 12 Mar 2024 21:59:04 +0100 Subject: [PATCH] fix loop for copy --- pkg/steering/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/steering/controller.go b/pkg/steering/controller.go index 3c0b404..576da5a 100644 --- a/pkg/steering/controller.go +++ b/pkg/steering/controller.go @@ -202,7 +202,8 @@ func (c *Controller) Objects() []*events.Object { defer c.muObjects.RUnlock() res := make([]*events.Object, 0, len(c.objects)) for _, o := range c.objects { - res = append(res, o) + oCpy := o + res = append(res, oCpy) } zap.S().Debugf("copy object from %v to %v", c.objects, res) return res