Avoid Atoi to avoid int convertion
This commit is contained in:
parent
8702db568c
commit
0f48b27a04
11 changed files with 32 additions and 39 deletions
|
@ -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.
|
||||
|
|
Reference in a new issue