Skip to content

Commit

Permalink
remove unnecessary nil checks before calling len() on slices
Browse files Browse the repository at this point in the history
  • Loading branch information
knbr13 committed Jan 5, 2025
1 parent 9be182e commit 5e330c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (r *Transport) RoundTrip(req *http.Request) (mockResponse *http.Response, e
r.debug.mock(mockResponse, req)
}()

if r.observers != nil && len(r.observers) > 0 {
if len(r.observers) > 0 {
defer func() {
for _, observe := range r.observers {
observe(mockResponse, req, r.specTest)
Expand Down

0 comments on commit 5e330c2

Please sign in to comment.