diff --git a/.golangci.yml b/.golangci.yml index 192eaa26..823623a7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -37,12 +37,6 @@ linters: - fieldalignment # err shadowing is idiomatic and used throughout the codebase. - shadow - revive: - rules: - # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter - - name: unused-parameter - severity: warning - disabled: true staticcheck: checks: - all diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index 199c2397..2d1e4c0a 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -14,7 +14,6 @@ // Package bootstrap provides a small bootstrap layer for exporters that want the // common exporter-toolkit web flags, logging setup, landing page wiring, and // listener startup behavior. - package bootstrap import ( diff --git a/web/handler_test.go b/web/handler_test.go index 210cb1d9..ac398633 100644 --- a/web/handler_test.go +++ b/web/handler_test.go @@ -26,7 +26,7 @@ import ( // protected endpoint multiple times. func TestBasicAuthCache(t *testing.T) { server := &http.Server{ - Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Write([]byte("Hello World!")) }), } @@ -93,7 +93,7 @@ func TestBasicAuthCache(t *testing.T) { // to prevent user enumeration. func TestBasicAuthWithFakepassword(t *testing.T) { server := &http.Server{ - Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Write([]byte("Hello World!")) }), } @@ -143,7 +143,7 @@ func TestBasicAuthWithFakepassword(t *testing.T) { // TestByPassBasicAuthVuln tests for CVE-2022-46146. func TestByPassBasicAuthVuln(t *testing.T) { server := &http.Server{ - Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Write([]byte("Hello World!")) }), } @@ -193,7 +193,7 @@ func TestByPassBasicAuthVuln(t *testing.T) { // TestHTTPHeaders validates that HTTP headers are added correctly. func TestHTTPHeaders(t *testing.T) { server := &http.Server{ - Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Write([]byte("Hello World!")) }), } diff --git a/web/tls_config_test.go b/web/tls_config_test.go index a0dd1d41..7c663c9d 100644 --- a/web/tls_config_test.go +++ b/web/tls_config_test.go @@ -402,7 +402,7 @@ func TestConfigReloading(t *testing.T) { server := &http.Server{ Addr: port, - Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Write([]byte("Hello World!")) }), } @@ -479,7 +479,7 @@ func (test *TestInputs) Test(t *testing.T) { }() server := &http.Server{ - Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.Write([]byte("Hello World!")) }), } @@ -626,7 +626,7 @@ func getTLSClient(clientCertName string) *http.Client { caCertPool.AppendCertsFromPEM(cert) return caCertPool }(), - GetClientCertificate: func(req *tls.CertificateRequestInfo) (*tls.Certificate, error) { + GetClientCertificate: func(_ *tls.CertificateRequestInfo) (*tls.Certificate, error) { return &clientCertficate, nil }, },