bndr / gojenkins

Jenkins API Client in Go. Looking for maintainers to move this project forward.
Apache License 2.0
870 stars 446 forks source link

queue.go has still a bug #271

Open Pymann opened 2 years ago

Pymann commented 2 years ago

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.