Revert wrong use of slices.Delete()

This commit is contained in:
Holger Obermaier
2026-02-11 14:02:47 +01:00
parent 6bfdd6ff17
commit 2cca8d6ac0

View File

@@ -337,7 +337,9 @@ func (c *metricAggregator) DeleteAggregation(name string) error {
if i == -1 {
return fmt.Errorf("no aggregation for metric name %s", name)
}
c.functions = slices.Delete(c.functions, i, i)
copy(c.functions[i:], c.functions[i+1:])
c.functions[len(c.functions)-1] = nil
c.functions = c.functions[:len(c.functions)-1]
return nil
}