From e4faf75aebaa0419f24f2298063f492b77f906b7 Mon Sep 17 00:00:00 2001 From: Erik Winter Date: Wed, 25 Dec 2024 10:11:56 +0100 Subject: [PATCH] rename to tasks --- plan/command/delete_test.go | 8 ++++---- plan/storage/memory/task.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plan/command/delete_test.go b/plan/command/delete_test.go index ae6963c..aac3dc0 100644 --- a/plan/command/delete_test.go +++ b/plan/command/delete_test.go @@ -43,9 +43,9 @@ func TestDelete(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - eventRepo := memory.NewTask() + taskRepo := memory.NewTask() syncRepo := memory.NewSync() - if err := eventRepo.Store(e); err != nil { + if err := taskRepo.Store(e); err != nil { t.Errorf("exp nil, got %v", err) } localRepo := memory.NewLocalID() @@ -53,7 +53,7 @@ func TestDelete(t *testing.T) { t.Errorf("exp nil, got %v", err) } - cmd := command.NewDelete(localRepo, eventRepo, syncRepo) + cmd := command.NewDelete(localRepo, taskRepo, syncRepo) actErr := cmd.Execute(tc.main, tc.flags) != nil if tc.expErr != actErr { @@ -63,7 +63,7 @@ func TestDelete(t *testing.T) { return } - _, repoErr := eventRepo.Find(e.ID) + _, repoErr := taskRepo.Find(e.ID) if !errors.Is(repoErr, storage.ErrNotFound) { t.Errorf("exp %v, got %v", storage.ErrNotFound, actErr) } diff --git a/plan/storage/memory/task.go b/plan/storage/memory/task.go index 184fa40..bfba997 100644 --- a/plan/storage/memory/task.go +++ b/plan/storage/memory/task.go @@ -35,8 +35,8 @@ func (t *Task) FindAll() ([]item.Task, error) { defer t.mutex.RUnlock() tasks := make([]item.Task, 0, len(t.tasks)) - for _, event := range t.tasks { - tasks = append(tasks, event) + for _, tsk := range t.tasks { + tasks = append(tasks, tsk) } sort.Slice(tasks, func(i, j int) bool { return tasks[i].ID < tasks[j].ID