go1.24: fix lint, unit and system tests

- development env: base on debian trixie with go1.24
- lint: run with default config
- fix lint errors
- fix unit tests
- fix system test
This commit is contained in:
André Roth
2025-04-12 17:53:48 +02:00
parent ae5379d84a
commit f7057a9517
117 changed files with 803 additions and 727 deletions
+6 -6
View File
@@ -31,7 +31,7 @@ func NewList() *List {
wgTasks: make(map[int]*sync.WaitGroup),
wg: &sync.WaitGroup{},
usedResources: NewResourcesSet(),
queue: make(chan *Task, 0),
queue: make(chan *Task),
queueWg: &sync.WaitGroup{},
queueDone: make(chan bool),
}
@@ -123,11 +123,11 @@ func (list *List) DeleteTaskByID(ID int) (Task, error) {
return *task, nil
}
return *task, fmt.Errorf("Task with id %v is still in state=%d", ID, task.State)
return *task, fmt.Errorf("task with id %v is still in state=%d", ID, task.State)
}
}
return Task{}, fmt.Errorf("Could not find task with id %v", ID)
return Task{}, fmt.Errorf("could not find task with id %v", ID)
}
// GetTaskByID returns task with given id
@@ -142,7 +142,7 @@ func (list *List) GetTaskByID(ID int) (Task, error) {
}
}
return Task{}, fmt.Errorf("Could not find task with id %v", ID)
return Task{}, fmt.Errorf("could not find task with id %v", ID)
}
// GetTaskOutputByID returns standard output of task with given id
@@ -236,14 +236,14 @@ func (list *List) WaitForTaskByID(ID int) (Task, error) {
wgTask, ok := list.wgTasks[ID]
list.Unlock()
if !ok {
return Task{}, fmt.Errorf("Could not find task with id %v", ID)
return Task{}, fmt.Errorf("could not find task with id %v", ID)
}
wgTask.Wait()
return list.GetTaskByID(ID)
}
// GetTaskError returns the Task error for a given id
// GetTaskErrorByID returns the Task error for a given id
func (list *List) GetTaskErrorByID(ID int) (error, error) {
task, err := list.GetTaskByID(ID)