Skip to content

Commit 62dae98

Browse files
committed
Merge remote-tracking branch 'origin/main' into validate-settings
2 parents a5f8757 + ee05993 commit 62dae98

25 files changed

+47
-47
lines changed

backend/app/instance_provider_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestInstanceProvider(t *testing.T) {
1919
type testInstance struct {
2020
value string
2121
}
22-
ip := NewInstanceProvider(func(ctx context.Context, settings backend.AppInstanceSettings) (instancemgmt.Instance, error) {
22+
ip := NewInstanceProvider(func(_ context.Context, _ backend.AppInstanceSettings) (instancemgmt.Instance, error) {
2323
return testInstance{value: "what an app"}, nil
2424
})
2525

backend/data_adapter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func newFakeDataHandlerWithOAuth() *fakeDataHandlerWithOAuth {
3434
panic("httpclient new: " + err.Error())
3535
}
3636

37-
svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
37+
svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
3838
w.WriteHeader(http.StatusOK)
3939
}))
4040

@@ -117,7 +117,7 @@ func TestQueryData(t *testing.T) {
117117

118118
t.Run("When tenant information is attached to incoming context, it is propagated from adapter to handler", func(t *testing.T) {
119119
tid := "123456"
120-
a := newDataSDKAdapter(QueryDataHandlerFunc(func(ctx context.Context, req *QueryDataRequest) (*QueryDataResponse, error) {
120+
a := newDataSDKAdapter(QueryDataHandlerFunc(func(ctx context.Context, _ *QueryDataRequest) (*QueryDataResponse, error) {
121121
require.Equal(t, tid, tenant.IDFromContext(ctx))
122122
return NewQueryDataResponse(), nil
123123
}))

backend/datasource/instance_provider_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestInstanceProvider(t *testing.T) {
1414
type testInstance struct {
1515
value string
1616
}
17-
ip := NewInstanceProvider(func(ctx context.Context, settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
17+
ip := NewInstanceProvider(func(_ context.Context, _ backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
1818
return testInstance{value: "hello"}, nil
1919
})
2020

backend/datasource/query_type_mux_example_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99

1010
func ExampleQueryTypeMux() {
1111
mux := datasource.NewQueryTypeMux()
12-
mux.HandleFunc("queryTypeA", func(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
12+
mux.HandleFunc("queryTypeA", func(_ context.Context, _ *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
1313
// handle queryTypeA
1414
return nil, nil
1515
})
16-
mux.HandleFunc("queryTypeB", func(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
16+
mux.HandleFunc("queryTypeB", func(_ context.Context, _ *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
1717
// handle queryTypeB
1818
return nil, nil
1919
})

backend/datasource/query_type_mux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestQueryTypeMux(t *testing.T) {
5252

5353
t.Run("When overriding fallback handler should call fallback handler", func(t *testing.T) {
5454
errBoom := errors.New("BOOM")
55-
mux.HandleFunc("", func(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
55+
mux.HandleFunc("", func(_ context.Context, _ *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
5656
return nil, errBoom
5757
})
5858
res, err = mux.QueryData(context.Background(), &backend.QueryDataRequest{

backend/diagnostics_adapter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func TestCheckHealth(t *testing.T) {
128128

129129
t.Run("When tenant information is attached to incoming context, it is propagated from adapter to handler", func(t *testing.T) {
130130
tid := "123456"
131-
a := newDiagnosticsSDKAdapter(nil, CheckHealthHandlerFunc(func(ctx context.Context, req *CheckHealthRequest) (*CheckHealthResult, error) {
131+
a := newDiagnosticsSDKAdapter(nil, CheckHealthHandlerFunc(func(ctx context.Context, _ *CheckHealthRequest) (*CheckHealthResult, error) {
132132
require.Equal(t, tid, tenant.IDFromContext(ctx))
133133
return &CheckHealthResult{}, nil
134134
}))

backend/httpclient/contextual_middleware_example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func ExampleWithContextualMiddleware() {
1717

1818
parent := context.Background()
1919
ctx := httpclient.WithContextualMiddleware(parent,
20-
httpclient.MiddlewareFunc(func(opts httpclient.Options, next http.RoundTripper) http.RoundTripper {
20+
httpclient.MiddlewareFunc(func(_ httpclient.Options, next http.RoundTripper) http.RoundTripper {
2121
return httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
2222
req.Header.Set("X-Custom-Header", "val")
2323

backend/httpclient/http_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ func GetTLSConfig(opts ...Options) (*tls.Config, error) {
107107

108108
tlsOpts := clientOpts.TLS
109109

110-
// #nosec
111110
config := &tls.Config{
111+
// nolint:gosec
112112
InsecureSkipVerify: tlsOpts.InsecureSkipVerify,
113113
ServerName: tlsOpts.ServerName,
114114
}

backend/httpclient/http_client_example_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func ExampleNew() {
1414
Timeout: 5 * time.Second,
1515
},
1616
Middlewares: []httpclient.Middleware{
17-
httpclient.MiddlewareFunc(func(opts httpclient.Options, next http.RoundTripper) http.RoundTripper {
17+
httpclient.MiddlewareFunc(func(_ httpclient.Options, next http.RoundTripper) http.RoundTripper {
1818
return httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
1919
log.Println("Before outgoing request")
2020
res, err := next.RoundTrip(req)
@@ -45,7 +45,7 @@ func ExampleGetTransport() {
4545
Timeout: 5 * time.Second,
4646
},
4747
Middlewares: []httpclient.Middleware{
48-
httpclient.MiddlewareFunc(func(opts httpclient.Options, next http.RoundTripper) http.RoundTripper {
48+
httpclient.MiddlewareFunc(func(_ httpclient.Options, next http.RoundTripper) http.RoundTripper {
4949
return httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
5050
log.Println("Before outgoing request")
5151
res, err := next.RoundTrip(req)

backend/httpclient/http_client_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestNewClient(t *testing.T) {
4848

4949
t.Run("New() with non-empty opts should use default middleware", func(t *testing.T) {
5050
usedMiddlewares := []Middleware{}
51-
client, err := New(Options{ConfigureMiddleware: func(opts Options, existingMiddleware []Middleware) []Middleware {
51+
client, err := New(Options{ConfigureMiddleware: func(_ Options, existingMiddleware []Middleware) []Middleware {
5252
usedMiddlewares = existingMiddleware
5353
return existingMiddleware
5454
}})
@@ -67,7 +67,7 @@ func TestNewClient(t *testing.T) {
6767
usedMiddlewares := []Middleware{}
6868
client, err := New(Options{
6969
Middlewares: []Middleware{ctx.createMiddleware("mw1"), ctx.createMiddleware("mw2"), ctx.createMiddleware("mw3")},
70-
ConfigureMiddleware: func(opts Options, existingMiddleware []Middleware) []Middleware {
70+
ConfigureMiddleware: func(_ Options, existingMiddleware []Middleware) []Middleware {
7171
middlewares := existingMiddleware
7272
for i, j := 0, len(existingMiddleware)-1; i < j; i, j = i+1, j-1 {
7373
middlewares[i], middlewares[j] = middlewares[j], middlewares[i]
@@ -99,7 +99,7 @@ func TestNewClient(t *testing.T) {
9999
ctx := &testContext{}
100100
_, err := New(Options{
101101
Middlewares: []Middleware{ctx.createMiddleware("mw1")},
102-
ConfigureMiddleware: func(opts Options, existingMiddleware []Middleware) []Middleware {
102+
ConfigureMiddleware: func(_ Options, existingMiddleware []Middleware) []Middleware {
103103
return append(existingMiddleware, ctx.createMiddleware("mw1"))
104104
},
105105
})
@@ -163,14 +163,14 @@ type testContext struct {
163163
}
164164

165165
func (c *testContext) createRoundTripper(name string) http.RoundTripper {
166-
return RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
166+
return RoundTripperFunc(func(_ *http.Request) (*http.Response, error) {
167167
c.callChain = append(c.callChain, name)
168168
return &http.Response{StatusCode: http.StatusOK}, nil
169169
})
170170
}
171171

172172
func (c *testContext) createMiddleware(name string) Middleware {
173-
return NamedMiddlewareFunc(name, func(opts Options, next http.RoundTripper) http.RoundTripper {
173+
return NamedMiddlewareFunc(name, func(_ Options, next http.RoundTripper) http.RoundTripper {
174174
return RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
175175
c.callChain = append(c.callChain, fmt.Sprintf("before %s", name))
176176
res, err := next.RoundTrip(req)

0 commit comments

Comments
 (0)