Iter25#27
Open
MWT-proger wants to merge 7 commits intomainfrom
Open
Conversation
… в storage поставил заглушку
| } | ||
|
|
||
| ip, err := resolveIP(r) | ||
| fmt.Println(ip) |
| if !ok { | ||
| return nil, status.Error(codes.Internal, "") | ||
| } | ||
| fmt.Println(userID, in.ShortKeys) |
There was a problem hiding this comment.
И тут, прокинь просто логер и используй его везде
| } | ||
|
|
||
| // jsonShortenResponse - тело ответа для GetStats. | ||
| type jsonStatsResponse struct { |
| urls, users, err = s.storage.CountUsersAndUrls(ctx) | ||
|
|
||
| if err != nil { | ||
| return 0, 0, lErrors.InternalServicesError |
There was a problem hiding this comment.
А если у пользователя 0 ссылок? Протухли например, в таких ситуациях лучше кмк использовать указатели, потому что формально 0 вполне валидное значение
Owner
Author
There was a problem hiding this comment.
Если будут нули , то ошибки не будет
| } | ||
|
|
||
| // CountUsersAndUrls возвращает количество пользователей и сокращенных URL в сервисе. | ||
| func (s fileStorage) CountUsersAndUrls(ctx context.Context) (urls int, users int, err error) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.