From 0b506d1b9d48afef41b29097726594f8b0727952 Mon Sep 17 00:00:00 2001 From: a3510377 Date: Mon, 30 Sep 2024 15:46:08 +0000 Subject: [PATCH] Refactor code to remove unnecessary print statement --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 8ab1dec..4a19474 100644 --- a/main.go +++ b/main.go @@ -85,11 +85,10 @@ func checkAndNotification() error { for _, v := range notifications { text += fmt.Sprintf("%s: \n %s\n", v.County, strings.Join(v.Details, "\n ")) } - fmt.Println(text) sendNotifications := []WorkSchoolCloseData{} for _, data := range notifications { - if !areaNamesMap[data.County] { + if !areaNamesMap[data.County] || len(data.Details) == 0 { continue } @@ -97,6 +96,7 @@ func checkAndNotification() error { } if len(sendNotifications) > 0 { + fmt.Println(text) notification(WorkSchoolClose{Date: data.Date, Data: sendNotifications}) } }