From 7e8a2f6b907548cdb5b7efe565b32a8a8466e7a5 Mon Sep 17 00:00:00 2001 From: MytkoEnko Date: Sun, 30 Apr 2023 16:55:58 +0200 Subject: [PATCH] correct code style Signed-off-by: Dmytro Aleksieiev --- pkg/notify/notify.go | 3 +-- pkg/notify/notify_test.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/notify/notify.go b/pkg/notify/notify.go index e6b8a7c..6faa244 100644 --- a/pkg/notify/notify.go +++ b/pkg/notify/notify.go @@ -119,7 +119,6 @@ func (r *Receiver) Notify(data *alertmanager.Data, hashJiraLabel bool, updateSum } } - for CustomField := range issueCustomFields { if _, ok := issue.Fields.Unknowns[CustomField]; ok { if issue.Fields.Unknowns[CustomField] != issueCustomFields[CustomField] { @@ -315,7 +314,7 @@ func toGroupTicketLabel(groupLabels alertmanager.KV, hashJiraLabel bool) string func (r *Receiver) search(project, issueLabel string) (*jira.Issue, bool, error) { query := fmt.Sprintf("project=\"%s\" and labels=%q order by resolutiondate desc", project, issueLabel) options := &jira.SearchOptions{ - Fields: append([]string{"summary", "status", "resolution", "resolutiondate"}, r.conf.CustomFieldsToUpdate...), + Fields: append([]string{"summary", "status", "resolution", "resolutiondate"}, r.conf.CustomFieldsToUpdate...), MaxResults: 2, } diff --git a/pkg/notify/notify_test.go b/pkg/notify/notify_test.go index 5807be5..455bbef 100644 --- a/pkg/notify/notify_test.go +++ b/pkg/notify/notify_test.go @@ -180,7 +180,6 @@ func testReceiverConfig2() *config.ReceiverConfig { } } - func testReceiverConfigAutoResolve() *config.ReceiverConfig { reopen := config.Duration(1 * time.Hour) autoResolve := config.AutoResolve{State: "Done"} @@ -217,7 +216,7 @@ func testReceiverConfigWithCustomFields() *config.ReceiverConfig { Fields: tcontainer.MarshalMap(map[string]interface{}{ "customfield_12345": `{{ (index .Alerts 0).Annotations.AlertValue }}`, }), - CustomFieldsToUpdate: []string{"customfield_12345","non_existant_field"}, + CustomFieldsToUpdate: []string{"customfield_12345", "non_existant_field"}, } }