fix "range-loop variables always have the same address"

This commit is contained in:
marco 2024-04-30 16:18:01 +02:00
parent 844dc7b384
commit 09987ba4ce

View file

@ -26,11 +26,12 @@ func dedupAlerts(alerts []types.RuntimeAlert) ([]*models.Alert, error) {
continue
}
for k, src := range alert.Sources {
for k := range alert.Sources {
refsrc := *alert.Alert // copy
log.Tracef("source[%s]", k)
src := alert.Sources[k]
refsrc.Source = &src
dedupCache = append(dedupCache, &refsrc)
}