Add misspell, gocritic, and revive

This commit is contained in:
eikendev 2023-04-01 20:00:58 +02:00
parent 5e640800fe
commit 2c20e42a21
No known key found for this signature in database
GPG key ID: A1BDB1B28C8EF694
30 changed files with 79 additions and 43 deletions

View file

@ -25,16 +25,16 @@ func (d *Database) UpdateApplication(application *model.Application) error {
}
// GetApplicationByID returns the application with the given ID or nil.
func (d *Database) GetApplicationByID(ID uint) (*model.Application, error) {
func (d *Database) GetApplicationByID(id uint) (*model.Application, error) {
var application model.Application
err := d.gormdb.First(&application, ID).Error
err := d.gormdb.First(&application, id).Error
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, err
}
assert.Assert(application.ID == ID)
assert.Assert(application.ID == id)
return &application, err
}

View file

@ -1,3 +1,4 @@
// Package database provides definitions and functionality related to the database.
package database
import (

View file

@ -34,16 +34,16 @@ func (d *Database) UpdateUser(user *model.User) error {
}
// GetUserByID returns the user with the given ID or nil.
func (d *Database) GetUserByID(ID uint) (*model.User, error) {
func (d *Database) GetUserByID(id uint) (*model.User, error) {
var user model.User
err := d.gormdb.First(&user, ID).Error
err := d.gormdb.First(&user, id).Error
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, err
}
assert.Assert(user.ID == ID)
assert.Assert(user.ID == id)
return &user, err
}