fix(style): simplify group appends

This commit is contained in:
Łukasz Mierzwa
2018-08-11 08:29:03 +01:00
parent 7a6538e8ff
commit fb17ed7e31
4 changed files with 4 additions and 12 deletions

View File

@@ -134,9 +134,7 @@ func (m AlertMapper) Decode(source io.ReadCloser) ([]models.AlertGroup, error) {
}
}
for _, rcv := range receivers {
for _, ag := range rcv.Groups {
groups = append(groups, ag)
}
groups = append(groups, rcv.Groups...)
}
return groups, nil
}

View File

@@ -133,9 +133,7 @@ func (m AlertMapper) Decode(source io.ReadCloser) ([]models.AlertGroup, error) {
}
}
for _, rcv := range receivers {
for _, ag := range rcv.Groups {
groups = append(groups, ag)
}
groups = append(groups, rcv.Groups...)
}
return groups, nil
}

View File

@@ -132,9 +132,7 @@ func (m AlertMapper) Decode(source io.ReadCloser) ([]models.AlertGroup, error) {
}
}
for _, rcv := range receivers {
for _, ag := range rcv.Groups {
groups = append(groups, ag)
}
groups = append(groups, rcv.Groups...)
}
return groups, nil
}

View File

@@ -136,9 +136,7 @@ func (m AlertMapper) Decode(source io.ReadCloser) ([]models.AlertGroup, error) {
}
}
for _, rcv := range receivers {
for _, ag := range rcv.Groups {
groups = append(groups, ag)
}
groups = append(groups, rcv.Groups...)
}
return groups, nil
}