Skip to content
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

GODRIVER-3357 Bump golangci-lint for 1.23 compatibility #1823

Merged
merged 6 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
exclude: ^(vendor)

- repo: https://github.com/golangci/golangci-lint
rev: v1.59.1
rev: v1.60.1
hooks:
- id: golangci-lint

Expand All @@ -61,4 +61,4 @@ repos:
name: executable-shell
entry: chmod +x
language: system
types: [shell]
types: [shell]
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@ tasks:
install-golangci-lint:
internal: true
cmds:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1
24 changes: 12 additions & 12 deletions internal/integration/unified/event_verification.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,16 @@ func verifyCMAPEvents(client *clientEntity, expectedEvents *expectedEvents) erro
switch {
case evt.ConnectionCreatedEvent != nil:
if _, pooled, err = getNextPoolEvent(pooled, event.ConnectionCreated); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next pool event: %v", err.Error())
}
case evt.ConnectionReadyEvent != nil:
if _, pooled, err = getNextPoolEvent(pooled, event.ConnectionReady); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next pool event: %v", err.Error())
}
case evt.ConnectionClosedEvent != nil:
var actual *event.PoolEvent
if actual, pooled, err = getNextPoolEvent(pooled, event.ConnectionClosed); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next pool event: %v", err.Error())
}

if expectedReason := evt.ConnectionClosedEvent.Reason; expectedReason != nil {
Expand All @@ -333,12 +333,12 @@ func verifyCMAPEvents(client *clientEntity, expectedEvents *expectedEvents) erro
}
case evt.ConnectionCheckedOutEvent != nil:
if _, pooled, err = getNextPoolEvent(pooled, event.ConnectionCheckedOut); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next pool event: %v", err.Error())
}
case evt.ConnectionCheckOutFailedEvent != nil:
var actual *event.PoolEvent
if actual, pooled, err = getNextPoolEvent(pooled, event.ConnectionCheckOutFailed); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next pool event: %v", err.Error())
}

if expectedReason := evt.ConnectionCheckOutFailedEvent.Reason; expectedReason != nil {
Expand All @@ -348,12 +348,12 @@ func verifyCMAPEvents(client *clientEntity, expectedEvents *expectedEvents) erro
}
case evt.ConnectionCheckedInEvent != nil:
if _, pooled, err = getNextPoolEvent(pooled, event.ConnectionCheckedIn); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next pool event: %v", err.Error())
}
case evt.PoolClearedEvent != nil:
var actual *event.PoolEvent
if actual, pooled, err = getNextPoolEvent(pooled, event.ConnectionPoolCleared); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next pool event: %v", err.Error())
}
if expectServiceID := evt.PoolClearedEvent.HasServiceID; expectServiceID != nil {
if err := verifyServiceID(*expectServiceID, actual.ServiceID); err != nil {
Expand Down Expand Up @@ -513,7 +513,7 @@ func verifySDAMEvents(client *clientEntity, expectedEvents *expectedEvents) erro
case evt.ServerDescriptionChangedEvent != nil:
var got *event.ServerDescriptionChangedEvent
if got, changed, err = getNextServerDescriptionChangedEvent(changed); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next server description changed event: %v", err.Error())
}

prevDesc := evt.ServerDescriptionChangedEvent.NewDescription
Expand Down Expand Up @@ -544,7 +544,7 @@ func verifySDAMEvents(client *clientEntity, expectedEvents *expectedEvents) erro
case evt.ServerHeartbeatStartedEvent != nil:
var got *event.ServerHeartbeatStartedEvent
if got, started, err = getNextServerHeartbeatStartedEvent(started); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next server heartbeat started event: %v", err.Error())
}

if want := evt.ServerHeartbeatStartedEvent.Awaited; want != nil && *want != got.Awaited {
Expand All @@ -553,7 +553,7 @@ func verifySDAMEvents(client *clientEntity, expectedEvents *expectedEvents) erro
case evt.ServerHeartbeatSucceededEvent != nil:
var got *event.ServerHeartbeatSucceededEvent
if got, succeeded, err = getNextServerHeartbeatSucceededEvent(succeeded); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next server heartbeat succeeded event: %v", err.Error())
}

if want := evt.ServerHeartbeatSucceededEvent.Awaited; want != nil && *want != got.Awaited {
Expand All @@ -562,15 +562,15 @@ func verifySDAMEvents(client *clientEntity, expectedEvents *expectedEvents) erro
case evt.ServerHeartbeatFailedEvent != nil:
var got *event.ServerHeartbeatFailedEvent
if got, failed, err = getNextServerHeartbeatFailedEvent(failed); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next server heartbeat failed event: %v", err.Error())
}

if want := evt.ServerHeartbeatFailedEvent.Awaited; want != nil && *want != got.Awaited {
return newEventVerificationError(idx, client, "want awaited %v, got %v", *want, got.Awaited)
}
case evt.TopologyDescriptionChangedEvent != nil:
if _, tchanged, err = getNextTopologyDescriptionChangedEvent(tchanged); err != nil {
return newEventVerificationError(idx, client, err.Error())
return newEventVerificationError(idx, client, "failed to get next description changed event: %v", err.Error())
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions mongo/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,9 +909,7 @@ func newLogger(opts options.Lister[options.LoggerOptions]) (*logger.Logger, erro

// If there are no component-level options and the environment does not
// contain component variables, then do nothing.
if (args.ComponentLevels == nil || len(args.ComponentLevels) == 0) &&
!logger.EnvHasComponentVariables() {

if len(args.ComponentLevels) == 0 && !logger.EnvHasComponentVariables() {
return nil, nil
}

Expand Down
Loading