Fix: linter complains
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user