Fix: linter complains

This commit is contained in:
Grail Finder
2025-07-05 13:33:34 +03:00
parent 913228844a
commit 5b24378956
3 changed files with 11 additions and 3 deletions

View File

@ -153,16 +153,19 @@ func (b *Bot) checkGuess(word string, room *models.Room) error {
room.ActionHistory = append(room.ActionHistory, action)
}
ctx, tx, err := repo.InitTx(context.Background())
// nolint: errcheck
defer tx.Commit()
if err != nil {
b.log.Error("failed to init tx", "error", err)
}
if err := repo.ActionCreate(ctx, &action); err != nil {
// nolint: errcheck
tx.Rollback()
b.log.Error("failed to create action", "error", err, "action", action)
return err
}
if err := repo.RoomUpdate(ctx, room); err != nil {
// nolint: errcheck
tx.Rollback()
b.log.Error("failed to save room", "room", room)
err = fmt.Errorf("fn: checkGuess, failed to save room; err: %w", err)