Closed hlts2 closed 2 months ago
The Join
function in the internal/errors
package has been updated to manage composite error scenarios more effectively. This involves handling *joinError
types and any errors implementing the Unwrap
method. Additionally, the function now returns nil
when all input errors are nil
, ensuring more accurate error combination and simplifying error handling logic. A new test, TestJoin
, has been added to validate these improvements.
File | Change Summary |
---|---|
internal/errors/errors.go |
Modified Join function to handle *joinError and errors with Unwrap , and return nil if no errors exist. |
internal/errors/errors_test.go |
Added TestJoin function to test various scenarios for the Join function, including returning nil for nil errors. |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
[CHATOPS:HELP] ChatOps commands.
/approve
- approve/format
- format codes and add licenses/gen-test
- generate test codes/label
- add labels/label actions/e2e-deploy
- run E2E deploy & integration testAttention: Patch coverage is 42.85714%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 18.95%. Comparing base (
84094b3
) to head (4733c80
).
Files | Patch % | Lines |
---|---|---|
internal/errors/errors.go | 42.85% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Latest commit: |
4733c80
|
Status: | ✅ Deploy successful! |
Preview URL: | https://42215b08.vald.pages.dev |
Branch Preview URL: | https://bugfix-internal-errors-join.vald.pages.dev |
Description
I fixed a problem that the result of Join does not return nil when three or more nil arguments are given.
Related Issue
Versions
Checklist
Special notes for your reviewer
Summary by CodeRabbit
Bug Fixes
nil
for empty ornil
error lists.Tests