Skip to content

HW10 is completed#16

Open
ezhk wants to merge 3 commits intomasterfrom
hw10_program_optimization
Open

HW10 is completed#16
ezhk wants to merge 3 commits intomasterfrom
hw10_program_optimization

Conversation

@ezhk
Copy link
Copy Markdown
Owner

@ezhk ezhk commented Aug 22, 2020

Домашнее задание №10 «Оптимизация программы»

Критерии оценки

  • Пайплайн зелёный и нет попытки «обмануть» систему - 4 балла
  • Добавлены юнит-тесты - до 3 баллов
  • Понятность и чистота кода - до 3 баллов

Зачёт от 7 баллов

Comment on lines +36 to +38
json := jsoniter.ConfigCompatibleWithStandardLibrary

func getUsers(r io.Reader) (result users, err error) {
content, err := ioutil.ReadAll(r)
if err != nil {
return
}
bufReader := bufio.NewReader(r)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

result = append(result, user.Email)
}

return
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Предлагаю указать возвращаемые значения в явном виде(не naked return)

if err != nil {
return nil, err
for _, email := range emails {
matched := re.MatchString(email)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Будет ещё чуть более оптимально, если использовать https://golang.org/pkg/strings/#HasSuffix вместо регулярного выражения

Copy link
Copy Markdown

@agneum agneum left a comment

Choose a reason for hiding this comment

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

Добрый день! Спасибо за отличную работу.

Итого: 10 баллов из 10.
Статус: принято

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