Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hw11 telnet client #11

Merged
merged 12 commits into from
Jan 8, 2025
Merged

Hw11 telnet client #11

merged 12 commits into from
Jan 8, 2025

Conversation

DimVlas
Copy link
Owner

@DimVlas DimVlas commented Jan 6, 2025

Домашнее задание №11 «Клиент TELNET»

Чек-лист студента (Что это?)

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

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

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

Copy link
Collaborator

@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. Принято

)

func parseArgs(args []string, timeout *time.Duration, host *string, port *int) error {
fs := flag.NewFlagSet("telnet", flag.ContinueOnError)
Copy link
Collaborator

Choose a reason for hiding this comment

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

fs выглядит как название пакета стандартной библиотеки.
Здесь он не импортируется, но название переменной немного запутывает

fs := flag.NewFlagSet("telnet", flag.ContinueOnError)
fs.SetOutput(bytes.NewBuffer(nil))

fs.DurationVar(timeout, "timeout", 10*time.Second, "Connection timeout")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Неизменяемые значения желательно выносить в константы

Comment on lines +52 to +61
scanner := bufio.NewScanner(tc.in)
for scanner.Scan() {
mess := append(scanner.Bytes(), '\n')
if _, err := tc.conn.Write(mess); err != nil {
return err
}
}
if err := scanner.Err(); err != nil {
return err
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Можно использовать io.Copy

@DimVlas DimVlas merged commit 8100cd0 into master Jan 8, 2025
3 checks passed
@DimVlas DimVlas deleted the hw11_telnet_client branch January 8, 2025 16:52
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