Use pointer receiver more offen

This commit is contained in:
nemunaire 2021-11-22 15:35:07 +01:00
parent 6999b4e728
commit c7569b5e54
59 changed files with 688 additions and 672 deletions

View file

@ -30,7 +30,7 @@ func getExerciceTested(u QAUser, ps httprouter.Params, body []byte) (interface{}
for _, exercice := range exercices {
if team.HasAccess(exercice) {
if ok, _ := team.HasSolved(exercice); ok {
if t := team.HasSolved(exercice); t != nil {
ret[exercice.Id] = "solved"
} else if cnt, _ := team.CountTries(exercice); cnt > 0 {
ret[exercice.Id] = "tried"
@ -74,7 +74,7 @@ func getQATodo(u QAUser, ps httprouter.Params, body []byte) (interface{}, error)
} else {
for _, exercice := range exercices {
if cnt, _ := team.CountTries(exercice); cnt > 0 {
todo = append(todo, fic.QATodo{0, team.Id, exercice.Id})
todo = append(todo, &fic.QATodo{0, team.Id, exercice.Id})
}
}
}