From 6963442a5e1774c22afcb9ce46b55ef704d08b9f Mon Sep 17 00:00:00 2001 From: tomofumi0003 <30283534+tomofumi0003@users.noreply.github.com> Date: Thu, 29 Sep 2022 16:08:36 +0900 Subject: [PATCH] fix(report): send report to each slack channel (#1530) * fix send report to each slack channel * fix(report): use w.Cnf.Channel instead of channel Co-authored-by: MaineK00n --- reporter/slack.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reporter/slack.go b/reporter/slack.go index ee0842ad..80d4394b 100644 --- a/reporter/slack.go +++ b/reporter/slack.go @@ -35,10 +35,10 @@ type message struct { func (w SlackWriter) Write(rs ...models.ScanResult) (err error) { - channel := w.Cnf.Channel for _, r := range rs { w.lang, w.osFamily = r.Lang, r.Family - if channel == "${servername}" { + channel := w.Cnf.Channel + if w.Cnf.Channel == "${servername}" { channel = fmt.Sprintf("#%s", r.ServerName) }