Return err
This commit is contained in:
@ -2,7 +2,6 @@ package models
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -105,7 +104,7 @@ func (e *ElectionModel) GetById(id int) (*Election, error) {
|
||||
}
|
||||
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, fmt.Errorf("error iterating over choices for election ID %d: %v", id, err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return election, nil
|
||||
|
Reference in New Issue
Block a user