-
Notifications
You must be signed in to change notification settings - Fork 163
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
slice: 支持 Diff*, Union*, SymmetricDiff*, Intersection*, Index* 方法 #83
Conversation
5147991
to
ec7afc7
Compare
看看我有没有漏掉你的 review,没有修改的 |
同时感谢 @penbox |
4f370ac
to
8ff85e1
Compare
Codecov Report
@@ Coverage Diff @@
## dev #83 +/- ##
==========================================
+ Coverage 91.40% 95.90% +4.50%
==========================================
Files 20 21 +1
Lines 721 879 +158
==========================================
+ Hits 659 843 +184
+ Misses 54 28 -26
Partials 8 8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
8ff85e1
to
918502a
Compare
加到了合作者中 |
918502a
to
538eacf
Compare
容量预估和非去重的版本,以后再实现 |
538eacf
to
f34334b
Compare
测试用例设计的不够全面,只考虑一般情况,边界情况未考虑. 后续补全、重构吧 |
f34334b
to
bc3188a
Compare
改了,再看看 @longyue0521 |
请仔细查看上面全部review,未折叠的表示问题还在或需要澄清 @flycash |
bc3188a
to
5882f93
Compare
应该都好了。nil 的那个,我改成了都返回空切片 |
后面你可以点 Resolve。一般就是谁开的对话,谁来 resolve |
func Map[Src any, Dst any](src []Src, m func(idx int, src Src) Dst) []Dst { | ||
return []Dst{} |
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.
Map让人感觉是从src[]T 构造map, 改为Mapping或者Convert, ConvertTo怎么样?
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.
这个是 map reduce API 中的 map。或者我们可以考虑有一个专门的 mapreduce 包,这样这个方法就可以重命名为 ConvertTo
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.
但是专门的 mapreduce 包看起来不是特别好,因为在其它数据结构里面也可以引入类似的 API
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.
依旧保留这个命名吧,我下一步就是要引入 reduce API。最开始我是计划在 Sum 的那个合并请求里面引入的
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestMap(t *testing.T) { |
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.
如果上方的Map要改,TestMap, ExampleMap也需要修改
slice/symmetric_diff.go
Outdated
} | ||
} | ||
|
||
return ret |
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.
ret需要去重, src = []int{1, 1, 2, 2, 3, 3}, dst = []int{2,2, 3, 3, 4, 4}; 添加测试用例并修复
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.
好了
这个Resolve是不是指review对话框右上角"..."里的hide->resolve 另外,当review过多时github展示时会hidden几个,隐藏的这几个我并没点resolve所以问题一直存在.我把原review关了,又开的新review. 下次看到“Load more”要点开看看,里面可能有问题未必解决 |
Co-authored-by: penbox <penbox86@126.com>
5882f93
to
f73003f
Compare
你说的每次 force push 确实是一个问题。 从排查问题的角度来说,一个合并请求只有一个 commit id 是稍微有点帮助的。但是我发现很多人不会 rebase,以及你提到的 review 的问题,所以我觉得后面可以不做这种要求。 |
@flycash 不知道什么原因,我看到的对话框和你看到的不一样,我这没有那个按钮 所以当我再次review时我能做的只是点击右侧三个点->hide->reslove comment以表示这个问题解决了. |
想要达到一个PR合并到dev时一个commit, 你在合并PR的时候可以试试Squash and merge选项,还可看看另一篇文档,将PR中的多个commit压缩成一个并自定义最终的message,应该可以达到你想要的效果. 上面的链接中有图示,更直观一些. 这个方法如果可行,PR中就可以不限制commit数了,review也能方便点 |
大意是如果PR是我开的即我是被review的人,我可以看到resolve conversation按钮, 还有就是对ekit有写权限的人能够看到. 看这个意思resolve conversation是给被review的人用的,修改完了点一下,相当于在对话下回复了一个”已修改“. |
No description provided.