Very informative variables in nested loop π ok -> okk -> okkk ....It might be okkkkkkkkkkkkkkkkkkkkkkkkkkkk in the end π
1 2 3 4 5 6 7 8 9 10 11 12 |
if user, ok := db.User[userId]; ok { for _, cardId := range user.CardIds { if card, okk := db.Card[cardId]; okk { if notif, okkk := db.Notif[card.NotifId]; okkk { card_notifs = append(card_notifs, CardNotif{card.Id, card, notif}) } } } c.JSON(http.StatusOK, card_notifs) } else { c.String(http.StatusNotFound, "") } |