Skip to content

Commit

Permalink
Refactor code to remove unnecessary print statement
Browse files Browse the repository at this point in the history
  • Loading branch information
a3510377 committed Sep 30, 2024
1 parent 299575f commit 0b506d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ 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
}

sendNotifications = append(sendNotifications, data)
}

if len(sendNotifications) > 0 {
fmt.Println(text)
notification(WorkSchoolClose{Date: data.Date, Data: sendNotifications})
}
}
Expand Down

0 comments on commit 0b506d1

Please sign in to comment.