Closed Danielius1922 closed 4 months ago
The changes in this update focus on enhancing error handling by replacing fmt.Errorf
with errors.New
, updating test assertion methods for stricter requirements, and making structural modifications like changing atomic.Value
to atomic.Pointer[context.Context]
. There is also an emphasis on improving code consistency and readability, especially around error generation and test assertions.
Files | Change Summary |
---|---|
.golangci.yml , message/codes/code_string.go , message/codes/codes.go , message/options_test.go , message/pool/message_test.go , message/status/status_test.go |
Enhanced error handling and test assertions; replaced fmt with errors for error creation. |
dtls/client_test.go , dtls/server/server.go , dtls/server/session.go , tcp/client/conn.go , tcp/client/session.go , udp/client/conn.go , udp/client/conn_test.go , udp/coder/bench_test.go , udp/coder/coder_test.go , udp/server/discover.go , udp/server/server.go , udp/server/session.go |
Replaced fmt.Errorf with errors.New ; updated assertions in tests; changed atomic.Value to atomic.Pointer[context.Context] . |
mux/router.go , mux/router_test.go , pkg/sync/map.go |
Updated import statements due to dependency updates. |
tcp/coder/bench_test.go , tcp/coder/coder_test.go |
Modified variable declarations and logic related to encoding. |
"In the realm of codes and bytes, where logic and magic takes flights,
A rabbit hopped, with fixes bright, under the moon's soft lights.
🌙✨
Errors now clear, witherrors.New
, as old woes bid adieu,
Asserts strict, and dependencies anew, a cleaner code in view.
🐇💻
So here's to changes, big and small, in the endless code's hall,
A hop, a skip, a joyous call, for progress, one and all."
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?
Failed conditions
25.0% Coverage on New Code (required ≥ 65%)
Attention: Patch coverage is 25.00000%
with 27 lines
in your changes are missing coverage. Please review.
Project coverage is 75.86%. Comparing base (
ce5dcc5
) to head (5f64797
).
Files | Patch % | Lines |
---|---|---|
net/blockwise/blockwise.go | 25.00% | 6 Missing :warning: |
net/connUDP.go | 25.00% | 3 Missing :warning: |
udp/server/discover.go | 0.00% | 3 Missing :warning: |
udp/server/server.go | 0.00% | 3 Missing :warning: |
dtls/server/server.go | 0.00% | 2 Missing :warning: |
net/observation/handler.go | 0.00% | 2 Missing :warning: |
tcp/server/server.go | 0.00% | 2 Missing :warning: |
udp/client/conn.go | 0.00% | 2 Missing :warning: |
message/codes/code_string.go | 0.00% | 1 Missing :warning: |
net/dtlslistener.go | 0.00% | 1 Missing :warning: |
... and 2 more |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
New Features
errors.New
for error creation across various components for improved error handling consistency.atomic.Pointer[context.Context]
for enhanced performance and safety.Refactor
fmt.Errorf
witherrors.New
in multiple places to standardize error creation.maps
package to a non-experimental one in router components.Bug Fixes
require.Equal
,require.NoError
,require.ErrorIs
) for better test clarity.Chores
.golangci.yml
for improved code quality and consistency.