Avoid Atoi to avoid int convertion
This commit is contained in:
parent
8702db568c
commit
0f48b27a04
11 changed files with 32 additions and 39 deletions
|
|
@ -59,13 +59,9 @@ func GetEvents() ([]Event, error) {
|
|||
}
|
||||
|
||||
// GetEvent retrieves the event with the given id
|
||||
func GetEvent(id int) (Event, error) {
|
||||
var e Event
|
||||
if err := DBQueryRow("SELECT id_event, txt, kind, time FROM events WHERE id_event=?", id).Scan(&e.Id, &e.Text, &e.Kind, &e.Time); err != nil {
|
||||
return e, err
|
||||
}
|
||||
|
||||
return e, nil
|
||||
func GetEvent(id int64) (e Event, err error) {
|
||||
err = DBQueryRow("SELECT id_event, txt, kind, time FROM events WHERE id_event=?", id).Scan(&e.Id, &e.Text, &e.Kind, &e.Time)
|
||||
return
|
||||
}
|
||||
|
||||
// NewEvent creates a new event in the database and returns the corresponding structure
|
||||
|
|
|
|||
Reference in a new issue