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

Test linting via bad commit #38

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
return nil
}

func newCertStore() *certStore {
func newCertStore(unused string) *certStore {

Check failure on line 190 in pkg/runner/runner.go

View workflow job for this annotation

GitHub Actions / build (1.23.3)

unused-parameter: parameter 'unused' seems to be unused, consider removing or renaming it as _ (revive)
return &certStore{}
}
Comment on lines +190 to 192
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove or rename the unused parameter.

The parameter 'unused' is not utilized in the function. Since this appears to be testing linting functionality, consider either:

  1. Removing the parameter if it's not needed
  2. Renaming it to _ if it must be kept but is intentionally unused

Apply this diff to fix the issue:

-func newCertStore(unused string) *certStore {
+func newCertStore() *certStore {
 	return &certStore{}
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func newCertStore(unused string) *certStore {
return &certStore{}
}
func newCertStore() *certStore {
return &certStore{}
}
🧰 Tools
🪛 golangci-lint (1.62.2)

[warning] 190-190: unused-parameter: parameter 'unused' seems to be unused, consider removing or renaming it as _

(revive)


Expand Down Expand Up @@ -816,7 +816,7 @@

if !edm.histogramSenderDisabled {
// Setup client cert/key for mTLS authentication
httpClientCertStore := newCertStore()
httpClientCertStore := newCertStore("unused")
err = httpClientCertStore.setCert(viper.GetString("http-client-cert-file"), viper.GetString("http-client-key-file"))
if err != nil {
edm.log.Error("unable to load x509 HTTP client cert", "error", err)
Expand All @@ -838,7 +838,7 @@

if !edm.mqttDisabled {
// Setup client cert/key for mTLS authentication
mqttClientCertStore := newCertStore()
mqttClientCertStore := newCertStore("unused")
err = mqttClientCertStore.setCert(viper.GetString("mqtt-client-cert-file"), viper.GetString("mqtt-client-key-file"))
if err != nil {
edm.log.Error("unable to load x509 mqtt client cert", "error", err)
Expand Down
Loading