mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-16 17:23:24 +03:00
chore: address linter's complaint in 1.0 branch (#546)
This commit is contained in:
committed by
Elias Schneider
parent
cb2a9f9f7d
commit
3896b7bb3b
@@ -43,11 +43,12 @@ func OneTimeAccessToken(args []string) error {
|
||||
Where("username = ? OR email = ?", userArg, userArg).
|
||||
First(&user).
|
||||
Error
|
||||
if errors.Is(txErr, gorm.ErrRecordNotFound) {
|
||||
switch {
|
||||
case errors.Is(txErr, gorm.ErrRecordNotFound):
|
||||
return errors.New("user not found")
|
||||
} else if txErr != nil {
|
||||
case txErr != nil:
|
||||
return fmt.Errorf("failed to query for user: %w", txErr)
|
||||
} else if user.ID == "" {
|
||||
case user.ID == "":
|
||||
return errors.New("invalid user loaded: ID is empty")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user