Capitalize error messages according to staticcheck
This commit is contained in:
parent
e3b69e8f83
commit
30f5497aa5
7 changed files with 48 additions and 48 deletions
|
@ -30,7 +30,7 @@ func (r *CourseRepo) FindById(id int) (models.Course, error) {
|
|||
func (r *CourseRepo) GetAll() ([]models.Course, error) {
|
||||
rows, err := r.db.Query("SELECT * FROM course ORDER BY name ASC")
|
||||
if err != nil {
|
||||
log.Printf("Error getting all courses: %s", err.Error())
|
||||
log.Printf("error getting all courses: %s", err.Error())
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
|
@ -56,9 +56,9 @@ func (r *CourseRepo) getFromRows(rows *sql.Rows) ([]models.Course, error) {
|
|||
func (r *CourseRepo) getFromRow(row *sql.Row) (models.Course, error) {
|
||||
var course models.Course
|
||||
if err := row.Scan(&course.Id, &course.Name); err != nil {
|
||||
err = fmt.Errorf("Error getting course row: %w", err)
|
||||
err = fmt.Errorf("error getting course row: %w", err)
|
||||
if !errors.Is(err, sql.ErrNoRows) {
|
||||
log.Printf(err.Error())
|
||||
log.Print(err.Error())
|
||||
}
|
||||
return models.Course{}, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue