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 <mainek00n.1229@gmail.com>
This commit is contained in:
tomofumi0003
2022-09-29 16:08:36 +09:00
committed by GitHub
parent f7299b9dba
commit 6963442a5e

View File

@@ -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)
}