Skip to content

Commit

Permalink
streamline disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
rosecodym committed Jul 31, 2023
1 parent b866e46 commit 2e3b1d3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/detectors/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ func verifyUri(uri string, timeout time.Duration) error {
if err != nil {
return err
}
defer func() {
_ = client.Disconnect(ctx)
}()
defer client.Disconnect(ctx)

Check failure on line 89 in pkg/detectors/mongodb/mongodb.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `client.Disconnect` is not checked (errcheck)
return client.Ping(ctx, readpref.Primary())
}

Expand Down

0 comments on commit 2e3b1d3

Please sign in to comment.