-
Notifications
You must be signed in to change notification settings - Fork 0
HW08 is completed #8
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
base: master
Are you sure you want to change the base?
Conversation
6cd8ea3 to
2c3143b
Compare
agneum
left a comment
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. Принято
|
|
||
| result := make(Environment) | ||
|
|
||
| files, err := ioutil.ReadDir(dir) |
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.
С Go 1.16 функции пакета ioutil помечены как deprecated, рекомендуется использовать функции пакета io и os: https://go.dev/doc/go1.16#ioutil
| return "", true, nil | ||
| } | ||
|
|
||
| file, err := os.Open(dir + "/" + fileInfo.Name()) |
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.
Для получения пути к файлу рекомендую использовать https://pkg.go.dev/path/filepath#Join
| func createTestDir(dir string) { | ||
| err := os.MkdirAll(dir, os.ModePerm) | ||
| if err != nil { | ||
| panic(fmt.Errorf("Error creating test directory: %w", 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.
Желательно не паниковать, даже в тестах. Предложил бы использовать функции пакета testify/require
|
|
||
| err := command.Start() | ||
| if err != nil { | ||
| panic(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.
В программе особенно не рекомендуется паниковать. Обработанная ошибка для пользователя будет выглядеть гораздо понятнее
| @@ -1,3 +1,5 @@ | |||
| module github.com/fixme_my_friend/hw08_envdir_tool | |||
| module github.com/sofiiakulish/hw08_envdir_tool | |||
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.
| module github.com/sofiiakulish/hw08_envdir_tool | |
| module github.com/sofiiakulish/hw/hw08_envdir_tool |
Домашнее задание №8 «Утилита envdir»
Чек-лист студента (Что это?)
go mod tidy..syncфайл. Зачем его удалять?test.sh).Критерии оценки
Зачёт от 7 баллов