Skip to content

Conversation

@PunyaI
Copy link
Contributor

@PunyaI PunyaI commented Dec 25, 2025

No description provided.

@PunyaI PunyaI self-assigned this Dec 25, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. На 27 строке MarshalJSON должен быть не указателем. На 35 у тебя уже правильно сделано
  2. формат времени можно в констатнту вынести

}
all = append(all, resp.Issues...)
offset += len(resp.Issues)
if len(resp.Issues) == 0 || offset >= resp.Total {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ИМХО, чуть читаемее было бы сравнивать len(all) с resp.total и offset в конце обновлять

jira/jira.go Outdated
availableStatuses[t.To.ID] = t.To.Name
if t.To.ID == targetStatusId {
targetTransitionID = t.ID
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Не вижу смысла каждый раз делать мапу для ошибки. Более того в функцию formatAvailableStatuses без проблем можно передать слайс и сильно там логика не поменяется
  2. тут вместо break можно вызывать сразу return j.TransitionIssue(ctx, issueKey, targetTransitionID)
  3. В ИИ эти измненения строил и функция получается намного читаемее

},
}
}
var Issue = newIssueSug()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Приписку Sug к названиям переменных нужно убрать везде

EventType EventType // Тип события
}
type Issue struct {
type IssueSug struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

все внктренние структуры тут я бы от греха сделал неэкспортируемыми

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants