Skip to content

checkout#1

Open
mirzhil wants to merge 2 commits intomainfrom
firstbranch
Open

checkout#1
mirzhil wants to merge 2 commits intomainfrom
firstbranch

Conversation

@mirzhil
Copy link
Copy Markdown
Owner

@mirzhil mirzhil commented Jun 7, 2025

No description provided.

Copy link
Copy Markdown

@dirtymew dirtymew left a comment

Choose a reason for hiding this comment

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

Привет Владимир

критичных замечаний нет - работа принята

func (ds *DaySteps) Parse(datastring string) error {
parts := strings.Split(datastring, ",")
if len(parts) != 2 {
return errors.New("некорректный формат строки для DaySteps")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ошибки на английском лучше - если явно не требуется другого

// RunningSpentCalories считает потраченные калории при беге.
func RunningSpentCalories(steps int, weight, height float64, duration time.Duration) (float64, error) {
if steps <= 0 || weight <= 0 || height <= 0 || duration <= 0 {
return 0, errors.New("некорректные параметры для расчёта калорий при беге")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ошибка не информативная - не понятно что конкретно не так

var err error

switch strings.ToLower(t.TrainingType) {
case "бег", "run", "running":
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"run", "running" таких кейсов нет

"Тип тренировки: Бег\nДлительность: %.2f ч.\nДистанция: %.2f км.\nСкорость: %.2f км/ч\nСожгли калорий: %.2f\n",
t.Duration.Hours(), distance, speed, calories,
), nil
case "ходьба", "walk", "walking":
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"walk", "walking" таких кейсов нет

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.

2 participants