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

fix: Linter fixes for plugins/outputs/[a-f]* #10124

Merged
merged 1 commit into from
Nov 18, 2021
Merged

fix: Linter fixes for plugins/outputs/[a-f]* #10124

merged 1 commit into from
Nov 18, 2021

Conversation

zak-pawel
Copy link
Collaborator

Following findings were fixed:

plugins/outputs/amon/amon.go:145:17                                       unconvert    unnecessary conversion
plugins/outputs/amqp/amqp.go:183:3                                        revive       import-shadowing: The name 'config' shadows an import name
plugins/outputs/amqp/amqp.go:254:4                                        revive       early-return: if c {...} else {... return } can be simplified to if !c { ... return } ...
plugins/outputs/amqp/amqp.go:255:5                                        ineffassign  ineffectual assignment to first
plugins/outputs/amqp/amqp.go:271:3                                        revive       unhandled-error: Unhandled error in call to function q.client.Close
plugins/outputs/amqp/amqp.go:318:2                                        revive       import-shadowing: The name 'config' shadows an import name
plugins/outputs/amqp/amqp.go:389:14                                       revive       import-shadowing: The name 'config' shadows an import name
plugins/outputs/amqp/client.go:7:2                                        revive       imports-blacklist: should not use the following blacklisted import: "log"
plugins/outputs/application_insights/application_insights_test.go:21:2    revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:38:2    revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:55:2    revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:140:4   revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:164:12  errcheck     Error return value of `ai.Write` is not checked
plugins/outputs/application_insights/application_insights_test.go:198:4   revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:222:12  errcheck     Error return value of `ai.Write` is not checked
plugins/outputs/application_insights/application_insights_test.go:268:4   revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:292:12  errcheck     Error return value of `ai.Write` is not checked
plugins/outputs/application_insights/application_insights_test.go:305:2   revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:333:10  errcheck     Error return value of `ai.Write` is not checked
plugins/outputs/application_insights/application_insights_test.go:342:2   revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:370:10  errcheck     Error return value of `ai.Write` is not checked
plugins/outputs/application_insights/application_insights_test.go:390:2   revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:391:2   revive       import-shadowing: The name 'metric' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:418:2   revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:419:2   revive       import-shadowing: The name 'metric' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:431:2   revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:432:2   revive       import-shadowing: The name 'metric' shadows an import name
plugins/outputs/application_insights/application_insights_test.go:458:24  revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/azure_monitor/azure_monitor.go:211:1                      revive       confusing-results: unnamed results of the same type may be confusing, consider using named results
plugins/outputs/azure_monitor/azure_monitor.go:369:2                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:370:2                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:376:3                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:377:3                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:381:2                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:382:2                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:576:2                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:577:2                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:578:2                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/azure_monitor/azure_monitor.go:579:2                      revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/cloudwatch/cloudwatch.go:339:8                            revive       unexported-naming: the symbol MaxDimensions is local, its name should start with a lowercase letter
plugins/outputs/cloudwatch/cloudwatch.go:395:2                            nakedret     naked return in func `getStatisticType` with 19 lines of code
plugins/outputs/cloudwatch/cloudwatch.go:423:3                            revive       bare-return: avoid using bare returns, please add return expressions
plugins/outputs/cloudwatch/cloudwatch.go:439:2                            nakedret     naked return in func `convert` with 42 lines of code
plugins/outputs/cloudwatch/cloudwatch_test.go:22:8                        revive       unexported-naming: the symbol MaxDimensions is local, its name should start with a lowercase letter
plugins/outputs/cloudwatch/cloudwatch_test.go:24:2                        revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/cloudwatch/cloudwatch_test.go:56:2                        revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/cloudwatch/cloudwatch_test.go:122:2                       revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/cloudwatch/cloudwatch_test.go:124:2                       revive       import-shadowing: The name 'metric' shadows an import name
plugins/outputs/cloudwatch/cloudwatch_test.go:153:2                       revive       import-shadowing: The name 'assert' shadows an import name
plugins/outputs/cloudwatch_logs/cloudwatch_logs_test.go:60:2              gosimple     S1011: should replace loop with `c.pushedLogEvents = append(c.pushedLogEvents, input.LogEvents...)`
plugins/outputs/cratedb/cratedb.go:50:3                                   revive       import-shadowing: The name 'sql' shadows an import name
plugins/outputs/cratedb/cratedb.go:109:2                                  revive       import-shadowing: The name 'sql' shadows an import name
plugins/outputs/cratedb/cratedb.go:209:2                                  revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/cratedb/cratedb.go:220:3                                  revive       unhandled-error: Unhandled error in call to function h.Write
plugins/outputs/datadog/datadog.go:203:17                                 unconvert    unnecessary conversion
plugins/outputs/datadog/datadog_test.go:39:28                             errcheck     Error return value of `` is not checked
plugins/outputs/datadog/datadog_test.go:54:28                             errcheck     Error return value of `` is not checked
plugins/outputs/elasticsearch/elasticsearch.go:7:2                        revive       imports-blacklist: should not use the following blacklisted import: "log"
plugins/outputs/elasticsearch/elasticsearch.go:260:2                      revive       unhandled-error: Unhandled error in call to function buffer.WriteString
plugins/outputs/elasticsearch/elasticsearch.go:261:2                      revive       unhandled-error: Unhandled error in call to function buffer.WriteString
plugins/outputs/elasticsearch/elasticsearch.go:262:2                      revive       unhandled-error: Unhandled error in call to function buffer.WriteString
plugins/outputs/elasticsearch/elasticsearch.go:356:12                     errcheck     Error return value of `t.Execute` is not checked
plugins/outputs/exec/exec.go:7:2                                          revive       imports-blacklist: should not use the following blacklisted import: "log"
plugins/outputs/exec/exec.go:80:2                                         revive       unhandled-error: Unhandled error in call to function buffer.Write
plugins/outputs/exec/exec.go:150:3                                        revive       unhandled-error: Unhandled error in call to function buf.WriteString
plugins/outputs/exec/exec_test.go:62:13                                   errcheck     Error return value of `e.Connect` is not checked
plugins/outputs/execd/execd_test.go:88:3                                  revive       import-shadowing: The name 'metric' shadows an import name
plugins/outputs/execd/execd_test.go:94:5                                  revive       unhandled-error: Unhandled error in call to function fmt.Fprintf
plugins/outputs/execd/execd_test.go:95:5                                  revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/outputs/execd/execd_test.go:97:4                                  revive       unhandled-error: Unhandled error in call to function fmt.Fprintf
plugins/outputs/execd/execd_test.go:98:4                                  revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/outputs/execd/execd_test.go:108:4                                 revive       unhandled-error: Unhandled error in call to function fmt.Fprintf
plugins/outputs/execd/execd_test.go:109:4                                 revive       deep-exit: calls to os.Exit only in main() or init() functions
plugins/outputs/file/file_test.go:169:10                                  errcheck     Error return value of `io.Copy` is not checked
plugins/outputs/file/file_test.go:174:2                                   revive       unhandled-error: Unhandled error in call to function w.Close
plugins/outputs/file/file_test.go:187:15                                  errcheck     Error return value of `f.WriteString` is not checked

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Nov 18, 2021
@telegraf-tiger
Copy link
Contributor

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@srebhan srebhan self-assigned this Nov 18, 2021
@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 18, 2021
@powersj powersj merged commit 3dc5281 into influxdata:master Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug linter ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants