-
Notifications
You must be signed in to change notification settings - Fork 77
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 error returning timing of doSearch function #1996
Conversation
[CHATOPS:HELP] ChatOps commands.
|
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #1996 +/- ##
==========================================
- Coverage 29.63% 29.44% -0.20%
==========================================
Files 365 365
Lines 34245 34429 +184
==========================================
- Hits 10150 10139 -11
- Misses 23676 23871 +195
Partials 419 419
... and 3 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
7c96933
to
cd0e69f
Compare
Deploying with Cloudflare Pages
|
[GEN TEST] Failed to generate tests. |
cd0e69f
to
3cc3cb6
Compare
c25fbce
to
559256e
Compare
Signed-off-by: kpango <[email protected]>
559256e
to
4203241
Compare
[FOSSA] The scan result will be available at https://app.fossa.com/projects/custom%2B21465%2Fvald/refs/branch/refactor%2Fgateway-lb%2Fsearch-error-return-timing/64cfab17d6d670e08d1ff6b597d93b029daeea45 |
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
Profile Report
|
switch { | ||
case errs[0] != nil && errs[1] != nil && !Is(errs[0], errs[1]): | ||
var es []error | ||
switch x := errs[1].(type) { |
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.
🚫 [golangci] reported by reviewdog 🐶
type switch on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
case 1: | ||
return e.errs[0].Error() | ||
} | ||
b := make([]byte, 0, len(e.errs)*16) |
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.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 16, in detected (gomnd)
if errs[0] != nil { | ||
return errs[0] | ||
} | ||
case 2: |
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.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 2, in detected (gomnd)
Description:
LB gateway should use early return error logic for performance, I changed it.
And errors.Join usually uses 1, or 2 errors it should be optimize, I did it.
internal/net/grpc/client span didn't record its error corectly, I fixed it.
Related Issue:
Versions:
Checklist:
Special notes for your reviewer: