Restructure version.Update to use channel

This commit is contained in:
M Essam Hamed
2025-09-01 15:13:13 +03:00
parent c6328788ca
commit 762b9b7b56
5 changed files with 52 additions and 25 deletions
+3 -3
View File
@@ -25,7 +25,7 @@ func TestNewUpdate(t *testing.T) {
onUpdate := false
u := NewUpdate(httpAgent)
defer u.StopWatch()
u.SetOnUpdateListener(func(_ string) {
u.SetOnUpdateListener(func() {
onUpdate = true
wg.Done()
})
@@ -50,7 +50,7 @@ func TestDoNotUpdate(t *testing.T) {
onUpdate := false
u := NewUpdate(httpAgent)
defer u.StopWatch()
u.SetOnUpdateListener(func(_ string) {
u.SetOnUpdateListener(func() {
onUpdate = true
wg.Done()
})
@@ -75,7 +75,7 @@ func TestDaemonUpdate(t *testing.T) {
onUpdate := false
u := NewUpdate(httpAgent)
defer u.StopWatch()
u.SetOnUpdateListener(func(_ string) {
u.SetOnUpdateListener(func() {
onUpdate = true
wg.Done()
})