bndr/gojenkins

queue.go has still a bug

Pymann opened this issue · 0 comments

func (q *Queue) Tasks() []*Task {
tasks := make([]*Task, len(q.Raw.Items))
for i, t := range q.Raw.Items {
tasks[i] = &Task{Jenkins: q.Jenkins, Queue: q, Raw: &t} //This function is still wrong, because &t will always stay the same pointer. You have to use: &q.Raw.Items[i]
}
return tasks
}

I claim, that there is no test for this function.