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

style: Enable errcheck linter and associated recommendations #3736

Merged
merged 1 commit into from
Sep 30, 2021
Merged

style: Enable errcheck linter and associated recommendations #3736

merged 1 commit into from
Sep 30, 2021

Conversation

bnevis-i
Copy link
Collaborator

See #3565

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?) Not adding functionality.
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?) Not adding functionality.
  • I have opened a PR for the related docs change (if not, why?) Not applicable.

Testing Instructions

make test; make docker; make run dev in edgex-compose

New Dependency Instructions (If applicable)

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.6% 1.6% Duplication

@@ -36,7 +36,7 @@ func distribute(dic *di.Container, n models.Notification) errors.EdgeX {
}
for _, address := range sub.Channels {
// Async transmit the notification to improve the performance
go transmit(dic, n, sub, address)
go transmit(dic, n, sub, address) // nolint:errcheck
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems clearer to just suppress the error.

@@ -35,7 +35,7 @@ func AddNotification(n models.Notification, ctx context.Context, dic *di.Contain
addedNotification.Id,
correlation.FromContext(ctx))

go distribute(dic, addedNotification)
go distribute(dic, addedNotification) // nolint:errcheck
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems clearer to just suppress the error.

@@ -112,7 +112,7 @@ func escalatedSend(dic *di.Container, n models.Notification, trans models.Transm
}

for _, address := range sub.Channels {
go transmit(dic, escalated, sub, address)
go transmit(dic, escalated, sub, address) // nolint:errcheck
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems clearer to just suppress the error.

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cloudxxx8
Copy link
Member

recheck

@cloudxxx8 cloudxxx8 merged commit 596e132 into edgexfoundry:main Sep 30, 2021
@bnevis-i bnevis-i deleted the edgex-go-3565-errcheck branch September 30, 2021 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants