Get returns a user-owned program with its exercises/sets, or sql.ErrNoRows.
(uid, id int64)
| 68 | return nil, err |
| 69 | } |
| 70 | programs[i].Days = days |
| 71 | } |
| 72 | idxByID, err := s.currentDayIndex(uid, programs) |
| 73 | if err != nil { |
| 74 | return nil, err |
| 75 | } |
| 76 | for i := range programs { |
| 77 | programs[i].CurrentDayIndex = idxByID[programs[i].ID] |
| 78 | } |
| 79 | return programs, nil |
| 80 | } |
| 81 | |
| 82 | // Get returns a user-owned program with its days/exercises/sets, or sql.ErrNoRows. |
| 83 | func (s *ProgramStore) Get(uid, id int64) (models.Program, error) { |
| 84 | var p models.Program |
| 85 | if err := scanProgram( |
| 86 | s.db.QueryRow(`SELECT `+programCols+` FROM programs WHERE id = ? AND user_id = ?`, id, uid), &p, |
nothing calls this directly
no test coverage detected