Skip to content

Commit 8cb0753

Browse files
Al2Klimovoxzi
authored andcommitted
Use utils.IterateOrderedMap() as intended, via for:=range (require Go 1.23)
1 parent 9e6a60b commit 8cb0753

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

notifications/plugin/plugin.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,15 @@ func FormatMessage(writer io.Writer, req *NotificationRequest) {
299299
}
300300
_, _ = fmt.Fprintf(writer, "Object: %s\n\n", req.Object.Url)
301301
_, _ = writer.Write([]byte("Tags:\n"))
302-
utils.IterateOrderedMap(req.Object.Tags)(func(k, v string) bool {
302+
for k, v := range utils.IterateOrderedMap(req.Object.Tags) {
303303
_, _ = fmt.Fprintf(writer, "%s: %s\n", k, v)
304-
return true
305-
})
304+
}
306305

307306
if len(req.Object.ExtraTags) > 0 {
308307
_, _ = writer.Write([]byte("\nExtra Tags:\n"))
309-
utils.IterateOrderedMap(req.Object.ExtraTags)(func(k, v string) bool {
308+
for k, v := range utils.IterateOrderedMap(req.Object.ExtraTags) {
310309
_, _ = fmt.Fprintf(writer, "%s: %s\n", k, v)
311-
return true
312-
})
310+
}
313311
}
314312

315313
_, _ = fmt.Fprintf(writer, "\nIncident: %s", req.Incident.Url)

0 commit comments

Comments
 (0)