This Go program is a simple reminder application that displays a notification every 20 minutes reminding the user to drink water. It uses the github.com/go-toast/toast
package to display notifications on Windows systems.
Here's a breakdown of the code:
- The
notify
function is defined to display a notification with the title "Reminder" and the message "It's time to drink water!" using thetoast.Notification
struct. The notification duration is set totoast.Long
. - Inside the
main
function, an infinite loop is used to repeatedly trigger the notification every 20 minutes. - Inside the loop, the
notify
function is called to display the notification. - The program then sleeps for 20 minutes using
time.Sleep(20 * time.Minute)
.
To use this program, you need to have the github.com/go-toast/toast
package installed. You can install it using the following command:
go get github.com/go-toast/toast
After installing the package, you can run the program, and it will display reminders to drink water every 20 minutes.
Make sure to customize the reminder message or adjust the interval according to your preferences.