Skip to content
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

mapx: LinkedMap 特性 #191

Merged
merged 35 commits into from
Jun 12, 2023
Merged

mapx: LinkedMap 特性 #191

merged 35 commits into from
Jun 12, 2023

Conversation

chenmingyong0423
Copy link
Collaborator

mapx: LinkedMap 特性

  • 新增 LinkedMap 结构体
  • 为 LinkedMap 实现 mapi 接口的方法
  • 为新增方法添加测试方法

chenmingyong0423 and others added 29 commits February 3, 2023 23:46
- 实现了 IsNilValue 方法,执行 IsNil 方法之前,先对类型进行判断,避免 panic。
- 编写 IsNilValue 方法的测试用例
- 修复 nil func 测试用例
- switch 语句里新增 case → reflect.UnsafePointer
- 新增 nil UnsafePointer 和 非 nil UnsafePointer 测试用例
- 创建 Strategy 重试策略接口
- 实现 EqualRetryStrategy 等时间间隔重试策略
- 编写 func (s *EqualRetryStrategy) Next()
- EqualRetryStrategy 变更为 FixedIntervalRetryStrategy
- 新增 NewErrInvalidIntervalValue 内部方法,返回无效的间隔时间的 error
- NewFixedIntervalRetryStrategy 新增对 interval 校验的逻辑
- 原子操作替代锁
- TestEqualRetryStrategy_Next 变更为 TestFixedIntervalRetryStrategy_Next
- TestNewFixedIntervalRetryStrategy 变更为 TestFixedIntervalRetryStrategy_New
- 新增指数退避重试策略(ExponentialBackoffRetryStrategy)
- 编写指数退避策略相关函数和方法的测试用例
- ExponentialBackoffRetryStrategy 结构体新增原子类型字段 maxIntervalReached,用于标记是否已经达到最大重试间隔,后续通过此字段判断如果达到最大重试间隔,则不需要再计算 interval
- 测试用例优化
- 测试用例函数优化
- 实现 MultiMap,一个多映射的 Map
- 提供 NewMultiTreeMap 和 NewMultiHashMap 方法
- 为新增函数和方法编写测试用例
- 实现 MultiMap,一个多映射的 Map
- 提供 NewMultiTreeMap 和 NewMultiHashMap 方法
- 为新增函数和方法编写测试用例
- 实现 MultiMap,一个多映射的 Map
- 提供 NewMultiTreeMap 和 NewMultiHashMap 方法
- 为新增函数和方法编写测试用例
- 新增 PutMany 方法,支持添加键值对或向已有键 k 的值追加多个数据
- 修改 Put 方法,内部调用 PutMany 方法
- 为新增方法添加测试方法
- 新增 PutMany 方法,支持添加键值对或向已有键 k 的值追加多个数据
- 修改 Put 方法,内部调用 PutMany 方法
- 为新增方法添加测试方法
- 新增 LinkedMap 结构体
- 为 LinkedMap 实现 mapi 接口的方法
- 为新增方法添加测试方法
@chenmingyong0423
Copy link
Collaborator Author

golangci-lint / lint (pull_request) 超时了 @flyhigher139

mapx/linkedmap.go Outdated Show resolved Hide resolved
mapx/linkedmap.go Show resolved Hide resolved
mapx/linkedmap.go Outdated Show resolved Hide resolved
mapx/linkedmap.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Show resolved Hide resolved
@longyue0521 longyue0521 linked an issue Jun 6, 2023 that may be closed by this pull request
Copy link
Contributor

@flycash flycash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@longyue0521 你觉得可以了就直接合并了

@longyue0521
Copy link
Collaborator

@longyue0521 你觉得可以了就直接合并了

好的

- 新增 LinkedMap 结构体
- 为 LinkedMap 实现 mapi 接口的方法
- 为新增方法添加测试方法
@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #191 (d946238) into dev (e671c5f) will increase coverage by 0.23%.
The diff coverage is 100.00%.

❗ Current head d946238 differs from pull request most recent head 1811723. Consider uploading reports for the commit 1811723 to get more accurate results

@@            Coverage Diff             @@
##              dev     #191      +/-   ##
==========================================
+ Coverage   95.76%   96.00%   +0.23%     
==========================================
  Files          45       46       +1     
  Lines        2431     2500      +69     
==========================================
+ Hits         2328     2400      +72     
+ Misses         81       79       -2     
+ Partials       22       21       -1     
Impacted Files Coverage Δ
mapx/linkedmap.go 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

mapx/linkedmap.go Outdated Show resolved Hide resolved
mapx/linkedmap.go Show resolved Hide resolved
mapx/linkedmap.go Outdated Show resolved Hide resolved
mapx/linkedmap.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
- 新增 LinkedMap 结构体
- 为 LinkedMap 实现 mapi 接口的方法
- 为新增方法添加测试方法
Copy link
Collaborator

@longyue0521 longyue0521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chenmingyong0423

将我之前review时留下的对话作为检查项,先自查一遍你修改后的代码,每确认一个修改就将对应的对话Resolve掉.将所有对话框都Resolve掉后再次发起review request.

@chenmingyong0423
Copy link
Collaborator Author

@chenmingyong0423

将我之前review时留下的对话作为检查项,先自查一遍你修改后的代码,每确认一个修改就将对应的对话Resolve掉.将所有对话框都Resolve掉后再次发起review request.

关于 error 测试用例那个,上面询问你了,看到回复下哈

@longyue0521
Copy link
Collaborator

@chenmingyong0423
将我之前review时留下的对话作为检查项,先自查一遍你修改后的代码,每确认一个修改就将对应的对话Resolve掉.将所有对话框都Resolve掉后再次发起review request.

关于 error 测试用例那个,上面询问你了,看到回复下哈

我查看了所有对话框,没有找到你的“询问”留言,你是不是没有提交成功?把你询问的对话框截图看看。

@chenmingyong0423
Copy link
Collaborator Author

@chenmingyong0423
将我之前review时留下的对话作为检查项,先自查一遍你修改后的代码,每确认一个修改就将对应的对话Resolve掉.将所有对话框都Resolve掉后再次发起review request.

关于 error 测试用例那个,上面询问你了,看到回复下哈

我查看了所有对话框,没有找到你的“询问”留言,你是不是没有提交成功?把你询问的对话框截图看看。

image

@longyue0521
Copy link
Collaborator

@chenmingyong0423
将我之前review时留下的对话作为检查项,先自查一遍你修改后的代码,每确认一个修改就将对应的对话Resolve掉.将所有对话框都Resolve掉后再次发起review request.

关于 error 测试用例那个,上面询问你了,看到回复下哈

我查看了所有对话框,没有找到你的“询问”留言,你是不是没有提交成功?把你询问的对话框截图看看。

image

图片中你头像右侧有pending字样证明你的评论未提交,你提交以下,我们在对应位置讨论,留下讨论轨迹。

mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
- 新增 LinkedMap 结构体
- 为 LinkedMap 实现 mapi 接口的方法
- 为新增方法添加测试方法
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
- 新增 LinkedMap 结构体
- 为 LinkedMap 实现 mapi 接口的方法
- 为新增方法添加测试方法
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
mapx/linkedmap_test.go Outdated Show resolved Hide resolved
- 新增 LinkedMap 结构体
- 为 LinkedMap 实现 mapi 接口的方法
- 为新增方法添加测试方法
longyue0521
longyue0521 previously approved these changes Jun 12, 2023
- 新增 LinkedMap 结构体
- 为 LinkedMap 实现 mapi 接口的方法
- 为新增方法添加测试方法
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mapx: LinkedMap 特性
3 participants