diff --git a/config/config.go b/config/config.go index 736e6234..573187c4 100644 --- a/config/config.go +++ b/config/config.go @@ -314,7 +314,7 @@ func (c *NotificationConfig) UnmarshalYAML(unmarshal func(interface{}) error) er // Regexp encapsulates a regexp.Regexp and makes it YAML marshallable. type Regexp struct { - regexp.Regexp + *regexp.Regexp } // UnmarshalYAML implements the yaml.Unmarshaler interface. @@ -327,7 +327,7 @@ func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error { if err != nil { return err } - re.Regexp = *regex + re.Regexp = regex return nil } diff --git a/dispatch_test.go b/dispatch_test.go index e8d40969..915121d9 100644 --- a/dispatch_test.go +++ b/dispatch_test.go @@ -90,7 +90,7 @@ func TestAggrGroup(t *testing.T) { t.Errorf("wrong repeat interval: %q", ri) } if sr, ok := notify.SendResolved(ctx); !ok || sr != opts.SendResolved { - t.Errorf("wrong send_resolved: %q", sr) + t.Errorf("wrong send_resolved: %v", sr) } last = current diff --git a/notify/notify.go b/notify/notify.go index 326d8443..6a524bac 100644 --- a/notify/notify.go +++ b/notify/notify.go @@ -167,8 +167,6 @@ func (n *RetryNotifier) Notify(ctx context.Context, alerts ...*types.Alert) erro return ctx.Err() } } - - return nil } type DedupingNotifier struct { diff --git a/notify/notify_test.go b/notify/notify_test.go index b034e580..e03a9e29 100644 --- a/notify/notify_test.go +++ b/notify/notify_test.go @@ -155,7 +155,7 @@ func TestDedupingNotifier(t *testing.T) { // After a failing notify the notifies data must be unchanged. nsCur, err := notifies.Get("name", fps...) if err != nil { - t.Fatalf("Error getting notifies", err) + t.Fatalf("Error getting notifies: %s", err) } if !reflect.DeepEqual(nsBefore, nsCur) { t.Fatalf("Notifies data has changed unexpectedly") @@ -220,7 +220,7 @@ func TestDedupingNotifier(t *testing.T) { } nsCur, err = notifies.Get("name", fps...) if err != nil { - t.Fatalf("Error getting notifies", err) + t.Fatalf("Error getting notifies: %s", err) } // Hack correct timestamps back in if they are sane. diff --git a/types/match.go b/types/match.go index 18767a70..c3aaecaf 100644 --- a/types/match.go +++ b/types/match.go @@ -110,7 +110,7 @@ func (ms Matchers) Fingerprint() model.Fingerprint { lset := make(model.LabelSet, 3*len(ms)) for _, m := range ms { - lset[model.LabelName(fmt.Sprintf("%s-%s-%s", m.Name, m.Value, m.isRegex))] = "" + lset[model.LabelName(fmt.Sprintf("%s-%s-%v", m.Name, m.Value, m.isRegex))] = "" } return lset.Fingerprint()