-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
Hw09 struct validator
merge hw10_program_optimization
There was a problem hiding this 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) |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Неизменяемые значения желательно выносить в константы
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 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно использовать io.Copy
Домашнее задание №11 «Клиент TELNET»
Чек-лист студента (Что это?)
go mod tidy
..sync
файл. Зачем его удалять?test.sh
).Критерии оценки
Зачёт от 7 баллов