-
Notifications
You must be signed in to change notification settings - Fork 381
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
refactor: replace experimental libraries with their std versions #1620
Conversation
@G-Rath I think some tests break due to this change - can you help to fix? |
4f6cc2c
to
07924ad
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1620 +/- ##
=======================================
Coverage 64.60% 64.60%
=======================================
Files 156 156
Lines 16014 16014
=======================================
Hits 10346 10346
Misses 4986 4986
Partials 682 682 ☔ View full report in Codecov by Sentry. |
22a42de
to
3ec88e0
Compare
@@ -423,7 +423,7 @@ func makeResultVuln(vuln resolution.Vulnerability) vulnOutput { | |||
vk := sg.Nodes[sg.Dependency].Version | |||
affected[packageOutput{Name: vk.Name, Version: vk.Version}] = struct{}{} | |||
} | |||
v.Packages = slices.Collect(maps.Keys(affected)) | |||
v.Packages = slices.AppendSeq(make([]packageOutput, 0, len(affected)), maps.Keys(affected)) |
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.
Is this needed? It seems weird the .Collect doesn't reallocate slices.
Even if it does not, I think it is better to stick with Collect here until we see that this causes a performance problem just for code clarity
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.
Apparently using slices.AppendSeq
is the "simplest true equivalent", and there is a performance difference.
It doesn't look like there's much difference between slices.Collect
though, so I'm not fussed - I can do some benchmarking later too
88c4e55
to
7923b1d
Compare
7923b1d
to
93546ec
Compare
These became stable in Go v1.21, so we can stop using the
x/exp
versions(this will be enforced by the
expotostd
linter which is being introduced in the next version of golanglint-ci)