Skip to content

HW11 is completed#17

Open
ezhk wants to merge 5 commits intomasterfrom
hw11_telnet_client
Open

HW11 is completed#17
ezhk wants to merge 5 commits intomasterfrom
hw11_telnet_client

Conversation

@ezhk
Copy link
Copy Markdown
Owner

@ezhk ezhk commented Aug 30, 2020

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

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

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

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

@ezhk
Copy link
Copy Markdown
Owner Author

ezhk commented Aug 30, 2020

❯ go test -v ./...
zsh: correct './...' to './..' [nyae]? n
=== RUN   TestExtendedTelnetClient
=== RUN   TestExtendedTelnetClient/extended
--- PASS: TestExtendedTelnetClient (1.00s)
    --- PASS: TestExtendedTelnetClient/extended (1.00s)
=== RUN   TestTelnetClient
=== RUN   TestTelnetClient/basic
--- PASS: TestTelnetClient (0.00s)
    --- PASS: TestTelnetClient/basic (0.00s)
PASS
ok  	github.com/ezhk/golang-learning/hw11_telnet_client	(cached)


address, timeout, err := ParseArguments()
if err != nil {
fmt.Fprintf(os.Stderr, "...Incorrect arguments: %q\n", err)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ещё можно использовать log.Fatalf(...).

if err := c.Connect(); err != nil {
fmt.Fprintln(os.Stderr, "...Connect error:", err)
os.Exit(1)
} else {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Можно убрать ветку else и сделать сразу принт.

type TelnetClient interface {
// Place your code here
Connect() error
Close() error
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

можно воспользоваться композицией и использовать io.Closer

@farir1408
Copy link
Copy Markdown
Collaborator

Здравствуйте!

Спасибо за выполнение домашнего задания.

Хорошая работа, принято 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