Avoid Atoi to avoid int convertion

This commit is contained in:
nemunaire 2018-12-01 16:15:28 +01:00
parent 8702db568c
commit 0f48b27a04
11 changed files with 32 additions and 39 deletions

View file

@ -161,12 +161,9 @@ func (e *Exercice) FixURLId() bool {
}
// GetThemeId returns the theme's id for the Exercice.
func (e Exercice) GetThemeId() (int, error) {
var tid int
if err := DBQueryRow("SELECT id_theme FROM exercices WHERE id_exercice=?", e.Id).Scan(&tid); err != nil {
return 0, err
}
return tid, nil
func (e Exercice) GetThemeId() (tid int64, err error) {
err = DBQueryRow("SELECT id_theme FROM exercices WHERE id_exercice=?", e.Id).Scan(&tid)
return
}
// GetTheme returns the parent Theme where the Exercice lives.