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
}
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.