make tasks use map instead of slice

This commit is contained in:
Robin Olsen
2026-02-23 13:13:34 +01:00
parent 2c2fbac3a3
commit 8decd74952
5 changed files with 28 additions and 24 deletions

View File

@@ -40,7 +40,7 @@ func RegisterTask(name string, constructor func(*service.App) Tasker) {
taskRegistry[name] = constructor
}
func GetTasks(name string, app *service.App) (Tasker, error) {
func GetTask(name string, app *service.App) (Tasker, error) {
constructor, ok := taskRegistry[name]
if !ok {
return nil, fmt.Errorf("task %q not found", name)