add some comments

This commit is contained in:
Drew Weymouth
2023-04-08 08:59:39 -07:00
parent a6b5e03476
commit 7298b6f8b9
10 changed files with 25 additions and 0 deletions
+4
View File
@@ -9,6 +9,8 @@ import (
"time"
)
// A component to check for updates from the
// Github releases/latest URL.
type UpdateChecker struct {
OnUpdatedVersionFound func()
@@ -26,6 +28,8 @@ func NewUpdateChecker(appVersionTag, latestReleaseURL string, lastCheckedTag *st
}
}
// Start automatically polling for updates in the background.
// Quits when the given ctx's Done channel returns a value.
func (u *UpdateChecker) Start(ctx context.Context, interval time.Duration) {
go func() {
u.checkForUpdate() // check once at startup