From b4f6653cccf7ee89c754794eb15f4a22e7f0a111 Mon Sep 17 00:00:00 2001 From: c9s Date: Sun, 16 May 2021 01:21:35 +0800 Subject: [PATCH] prefer PlainText interface over String interface --- pkg/notifier/telegramnotifier/telegram.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/notifier/telegramnotifier/telegram.go b/pkg/notifier/telegramnotifier/telegram.go index bbe8d68b0..39257cb10 100644 --- a/pkg/notifier/telegramnotifier/telegram.go +++ b/pkg/notifier/telegramnotifier/telegram.go @@ -67,12 +67,12 @@ func (n *Notifier) NotifyTo(channel string, obj interface{}, args ...interface{} log.Infof(a, pureArgs...) message = fmt.Sprintf(a, pureArgs...) - case types.Stringer: - message = a.String() - case types.PlainText: message = a.PlainText() + case types.Stringer: + message = a.String() + default: log.Errorf("unsupported notification format: %T %+v", a, a)