-
Notifications
You must be signed in to change notification settings - Fork 765
add lru queue and mockFileServer #1275
add lru queue and mockFileServer #1275
Conversation
56f4403 to
40b88a7
Compare
|
lgtm! |
2e13431 to
c4e6fb0
Compare
Codecov Report
@@ Coverage Diff @@
## master #1275 +/- ##
==========================================
+ Coverage 48.96% 49.74% +0.78%
==========================================
Files 119 120 +1
Lines 7763 7936 +173
==========================================
+ Hits 3801 3948 +147
- Misses 3647 3665 +18
- Partials 315 323 +8
Continue to review full report at Codecov.
|
| data interface{} | ||
| } | ||
|
|
||
| type LRUQueue struct { |
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.
add comments for export statement
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.
done.
dfget/core/helper/helper_test.go
Outdated
| return nil, fmt.Errorf("resp code %d", resp.StatusCode) | ||
| } | ||
|
|
||
| defer resp.Body.Close() |
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.
I am afraid that you should move this defer in front of the 400 judgement
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.
done.
Signed-off-by: allen.wq <allen.wq@alipay.com>
c4e6fb0 to
b3222f5
Compare
|
|
||
| result[index] = item.Value.(*cQElementData).data | ||
| index++ | ||
| if index >= count { |
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.
The index should be less the length of the list.
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.
if list is traversed to the end, the loop will be break by the case "item == nil"
lowzj
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.
LGTM
Signed-off-by: Jim Ma <majinjing3@gmail.com>
Signed-off-by: allen.wq allen.wq@alipay.com
Ⅰ. Describe what this PR did
Add the lru queue and mock file server. It may be used in some test.
Ⅱ. Does this pull request fix one issue?
NONE.
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Already add it.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews