-
Notifications
You must be signed in to change notification settings - Fork 0
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
Инкремент 18. Документация #61
Conversation
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.
Можно еще добавить процент покрытия тестами прямо в репе, в виде плашки, мелочь, а приятно
errorString, err := io.ReadAll(resp.Body) | ||
if err != nil { | ||
errorString = []byte("cant read body of response") | ||
// видимо вот для таких случаев надо осознанно работать с ошибками |
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.
Точно
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.
хехе, рад, что ты оценил
} | ||
|
||
log.Info().Str("addr", profilerAddr).Msg("профилировщик остановлен") | ||
}() | ||
} | ||
|
||
// Часть IV | ||
// -------- | ||
// | ||
// Тут остались деферы, и сервер будет завершен аккуратно |
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.
Для этого wg.Wait
не принципиально
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.
Справедливо. Я сейчас переделывать не буду. Но концептуально, да. Ничего страшного если какая-то ошибка тут будет, правда
model.go
Outdated
"github.com/thefrol/kysh-kysh-meow/internal/server/app/metricas" | ||
) | ||
|
||
// С используется чтобы передавать |
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.
Не очень нравится названия структуры, хорошо если по названию и так можно понять зачем она примерно нужно, иначе трудно будет разобраться
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.
Исправил вот тут 0f83f4e
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.
В целом я просто часто такое видел как testing.T
, testing.B
, mongo.D
и прочее. Вообще я был не в восторге, но вдруг мне понравилось. И до сих пор думаю это классная идея, как будто это какой-то очень важный тип данных, раз его одной буквой пишут)
* script: add coverage script * cicd: add badges workflow * cicd: change badge file * cicd: генерировать файл по имени ветки * cicd: правильно обмениваться между шагами данными * cicd: покрасить бедж и вывести инфу * cicd: поменять имя раннера --------- Co-authored-by: Dima Frolenko <[email protected]>
Документирование
Такое уж дело, что у меня все лежит в
internal
, так что документировать особо нечего, кроме доступных пакетов, а там по-большей части все задокументировано. Но пока я писал примеры, я офигел как сложно пользоваться моим сервером и написал для него такой простой доступ, и все это положил прям в корень, и задокументировал.В целом я и раньше документировал, но вот, например баги никогда не добавлял
Примеры
Я тут сделал два примера, один - сырые запросы, другой при помощи пакета-помощника. В для тестов я поднимаю сервер, сделал его в файле example_init_test.go
Значок покрытия тестами
теперь в https://gist.github.com/thefrol/571cee70d9542f9f39127a69ed007706 генерируются файлы с покрытием под бранчи, нужно передать это имя в ссылку вида