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)

backend/httpclient/provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (p *Provider) New(opts ...Options) (*http.Client, error) {
7575
clientOpts := p.createClientOptions(opts...)
7676

7777
var configuredTransport *http.Transport
78-
clientOpts.ConfigureTransport = configureTransportChain(clientOpts.ConfigureTransport, func(opts Options, transport *http.Transport) {
78+
clientOpts.ConfigureTransport = configureTransportChain(clientOpts.ConfigureTransport, func(_ Options, transport *http.Transport) {
7979
configuredTransport = transport
8080
})
8181

@@ -108,7 +108,7 @@ func (p *Provider) GetTransport(opts ...Options) (http.RoundTripper, error) {
108108
clientOpts := p.createClientOptions(opts...)
109109

110110
var configuredTransport *http.Transport
111-
clientOpts.ConfigureTransport = configureTransportChain(clientOpts.ConfigureTransport, func(opts Options, transport *http.Transport) {
111+
clientOpts.ConfigureTransport = configureTransportChain(clientOpts.ConfigureTransport, func(_ Options, transport *http.Transport) {
112112
configuredTransport = transport
113113
})
114114

backend/httpclient/provider_example_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func ExampleProvider_New() {
2121
Timeout: 5 * time.Second,
2222
},
2323
Middlewares: []httpclient.Middleware{
24-
httpclient.MiddlewareFunc(func(opts httpclient.Options, next http.RoundTripper) http.RoundTripper {
24+
httpclient.MiddlewareFunc(func(_ httpclient.Options, next http.RoundTripper) http.RoundTripper {
2525
return httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
2626
log.Println("Before outgoing request")
2727
res, err := next.RoundTrip(req)
@@ -54,7 +54,7 @@ func ExampleProvider_GetTransport() {
5454
Timeout: 5 * time.Second,
5555
},
5656
Middlewares: []httpclient.Middleware{
57-
httpclient.MiddlewareFunc(func(opts httpclient.Options, next http.RoundTripper) http.RoundTripper {
57+
httpclient.MiddlewareFunc(func(_ httpclient.Options, next http.RoundTripper) http.RoundTripper {
5858
return httpclient.RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
5959
log.Println("Before outgoing request")
6060
res, err := next.RoundTrip(req)

backend/httpclient/provider_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,21 @@ func newProviderTestContext(t *testing.T, opts ...ProviderOptions) *providerTest
214214
providerOpts = ProviderOptions{}
215215
}
216216

217-
providerOpts.ConfigureMiddleware = func(opts Options, existingMiddleware []Middleware) []Middleware {
217+
providerOpts.ConfigureMiddleware = func(_ Options, existingMiddleware []Middleware) []Middleware {
218218
ctx.configureMiddlewareCount++
219219
ctx.usedMiddlewares = make([]Middleware, len(existingMiddleware))
220220
copy(ctx.usedMiddlewares, existingMiddleware)
221221
return existingMiddleware
222222
}
223-
providerOpts.ConfigureClient = func(opts Options, client *http.Client) {
223+
providerOpts.ConfigureClient = func(_ Options, client *http.Client) {
224224
ctx.configureClientCount++
225225
ctx.client = client
226226
}
227-
providerOpts.ConfigureTransport = func(opts Options, transport *http.Transport) {
227+
providerOpts.ConfigureTransport = func(_ Options, transport *http.Transport) {
228228
ctx.configureTransportCount++
229229
ctx.transport = transport
230230
}
231-
providerOpts.ConfigureTLSConfig = func(opts Options, config *tls.Config) {
231+
providerOpts.ConfigureTLSConfig = func(_ Options, config *tls.Config) {
232232
ctx.configureTLSConfigCount++
233233
ctx.tlsConfig = config
234234
}

backend/httpclient/response_limit_middleware.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
const ResponseLimitMiddlewareName = "response-limit"
99

1010
func ResponseLimitMiddleware(limit int64) Middleware {
11-
return NamedMiddlewareFunc(ResponseLimitMiddlewareName, func(opts Options, next http.RoundTripper) http.RoundTripper {
11+
return NamedMiddlewareFunc(ResponseLimitMiddlewareName, func(_ Options, next http.RoundTripper) http.RoundTripper {
1212
return RoundTripperFunc(func(req *http.Request) (*http.Response, error) {
1313
res, err := next.RoundTrip(req)
1414
if err != nil {

backend/log_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestContextualLogger(t *testing.T) {
3636
pCtx := &pluginv2.PluginContext{PluginId: pluginID}
3737
t.Run("DataSDKAdapter", func(t *testing.T) {
3838
run := make(chan struct{}, 1)
39-
a := newDataSDKAdapter(QueryDataHandlerFunc(func(ctx context.Context, req *QueryDataRequest) (*QueryDataResponse, error) {
39+
a := newDataSDKAdapter(QueryDataHandlerFunc(func(ctx context.Context, _ *QueryDataRequest) (*QueryDataResponse, error) {
4040
checkCtxLogger(ctx, t, map[string]any{"endpoint": "queryData", "pluginID": pluginID})
4141
run <- struct{}{}
4242
return NewQueryDataResponse(), nil
@@ -50,7 +50,7 @@ func TestContextualLogger(t *testing.T) {
5050

5151
t.Run("DiagnosticsSDKAdapter", func(t *testing.T) {
5252
run := make(chan struct{}, 1)
53-
a := newDiagnosticsSDKAdapter(prometheus.DefaultGatherer, CheckHealthHandlerFunc(func(ctx context.Context, req *CheckHealthRequest) (*CheckHealthResult, error) {
53+
a := newDiagnosticsSDKAdapter(prometheus.DefaultGatherer, CheckHealthHandlerFunc(func(ctx context.Context, _ *CheckHealthRequest) (*CheckHealthResult, error) {
5454
checkCtxLogger(ctx, t, map[string]any{"endpoint": "checkHealth", "pluginID": pluginID})
5555
run <- struct{}{}
5656
return &CheckHealthResult{}, nil
@@ -64,7 +64,7 @@ func TestContextualLogger(t *testing.T) {
6464

6565
t.Run("ResourceSDKAdapter", func(t *testing.T) {
6666
run := make(chan struct{}, 1)
67-
a := newResourceSDKAdapter(CallResourceHandlerFunc(func(ctx context.Context, req *CallResourceRequest, sender CallResourceResponseSender) error {
67+
a := newResourceSDKAdapter(CallResourceHandlerFunc(func(ctx context.Context, _ *CallResourceRequest, _ CallResourceResponseSender) error {
6868
checkCtxLogger(ctx, t, map[string]any{"endpoint": "callResource", "pluginID": pluginID})
6969
run <- struct{}{}
7070
return nil
@@ -81,17 +81,17 @@ func TestContextualLogger(t *testing.T) {
8181
publishStreamRun := make(chan struct{}, 1)
8282
runStreamRun := make(chan struct{}, 1)
8383
a := newStreamSDKAdapter(&streamAdapter{
84-
subscribeStreamFunc: func(ctx context.Context, request *SubscribeStreamRequest) (*SubscribeStreamResponse, error) {
84+
subscribeStreamFunc: func(ctx context.Context, _ *SubscribeStreamRequest) (*SubscribeStreamResponse, error) {
8585
checkCtxLogger(ctx, t, map[string]any{"endpoint": "subscribeStream", "pluginID": pluginID})
8686
subscribeStreamRun <- struct{}{}
8787
return &SubscribeStreamResponse{}, nil
8888
},
89-
publishStreamFunc: func(ctx context.Context, request *PublishStreamRequest) (*PublishStreamResponse, error) {
89+
publishStreamFunc: func(ctx context.Context, _ *PublishStreamRequest) (*PublishStreamResponse, error) {
9090
checkCtxLogger(ctx, t, map[string]any{"endpoint": "publishStream", "pluginID": pluginID})
9191
publishStreamRun <- struct{}{}
9292
return &PublishStreamResponse{}, nil
9393
},
94-
runStreamFunc: func(ctx context.Context, request *RunStreamRequest, sender *StreamSender) error {
94+
runStreamFunc: func(ctx context.Context, _ *RunStreamRequest, _ *StreamSender) error {
9595
checkCtxLogger(ctx, t, map[string]any{"endpoint": "runStream", "pluginID": pluginID})
9696
runStreamRun <- struct{}{}
9797
return nil

backend/resource/httpadapter/doc_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
func Example() {
10-
handler := New(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
10+
handler := New(http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
1111
_, err := rw.Write([]byte("Hello world!"))
1212
if err != nil {
1313
return
@@ -21,7 +21,7 @@ func Example() {
2121

2222
func Example_serve_mux() {
2323
mux := http.NewServeMux()
24-
mux.HandleFunc("/hello", func(rw http.ResponseWriter, req *http.Request) {
24+
mux.HandleFunc("/hello", func(rw http.ResponseWriter, _ *http.Request) {
2525
_, err := rw.Write([]byte("Hello world!"))
2626
if err != nil {
2727
return

backend/resource/httpadapter/handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func TestServeMuxHandler(t *testing.T) {
181181
testSender := newTestCallResourceResponseSender()
182182
mux := http.NewServeMux()
183183
handlerWasCalled := false
184-
mux.HandleFunc("/test", func(rw http.ResponseWriter, req *http.Request) {
184+
mux.HandleFunc("/test", func(_ http.ResponseWriter, _ *http.Request) {
185185
handlerWasCalled = true
186186
})
187187
resourceHandler := New(mux)

backend/resource_adapter_test.go

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

159159
t.Run("When tenant information is attached to incoming context, it is propagated from adapter to handler", func(t *testing.T) {
160160
tid := "123456"
161-
a := newResourceSDKAdapter(CallResourceHandlerFunc(func(ctx context.Context, req *CallResourceRequest, sender CallResourceResponseSender) error {
161+
a := newResourceSDKAdapter(CallResourceHandlerFunc(func(ctx context.Context, _ *CallResourceRequest, _ CallResourceResponseSender) error {
162162
require.Equal(t, tid, tenant.IDFromContext(ctx))
163163
return nil
164164
}))

backend/stream_adapter_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestSubscribeStream(t *testing.T) {
1515
t.Run("When tenant information is attached to incoming context, it is propagated from adapter to handler", func(t *testing.T) {
1616
tid := "123456"
1717
a := newStreamSDKAdapter(&streamAdapter{
18-
subscribeStreamFunc: func(ctx context.Context, request *SubscribeStreamRequest) (*SubscribeStreamResponse, error) {
18+
subscribeStreamFunc: func(ctx context.Context, _ *SubscribeStreamRequest) (*SubscribeStreamResponse, error) {
1919
require.Equal(t, tid, tenant.IDFromContext(ctx))
2020
return &SubscribeStreamResponse{}, nil
2121
},
@@ -36,7 +36,7 @@ func TestPublishStream(t *testing.T) {
3636
t.Run("When tenant information is attached to incoming context, it is propagated from adapter to handler", func(t *testing.T) {
3737
tid := "123456"
3838
a := newStreamSDKAdapter(&streamAdapter{
39-
publishStreamFunc: func(ctx context.Context, request *PublishStreamRequest) (*PublishStreamResponse, error) {
39+
publishStreamFunc: func(ctx context.Context, _ *PublishStreamRequest) (*PublishStreamResponse, error) {
4040
require.Equal(t, tid, tenant.IDFromContext(ctx))
4141
return &PublishStreamResponse{}, nil
4242
},
@@ -57,7 +57,7 @@ func TestRunStream(t *testing.T) {
5757
t.Run("When tenant information is attached to incoming context, it is propagated from adapter to handler", func(t *testing.T) {
5858
tid := "123456"
5959
a := newStreamSDKAdapter(&streamAdapter{
60-
runStreamFunc: func(ctx context.Context, req *RunStreamRequest, sender *StreamSender) error {
60+
runStreamFunc: func(ctx context.Context, _ *RunStreamRequest, _ *StreamSender) error {
6161
require.Equal(t, tid, tenant.IDFromContext(ctx))
6262
return nil
6363
},

build/utils/copy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func compareDirs(t *testing.T, src, dst string) {
7979

8080
require.Equal(t, sfi.Mode(), dfi.Mode())
8181

82-
err = filepath.Walk(src, func(srcPath string, info os.FileInfo, err error) error {
82+
err = filepath.Walk(src, func(srcPath string, _ os.FileInfo, err error) error {
8383
if err != nil {
8484
return err
8585
}

data/framestruct/converter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ func TestToDataframe(t *testing.T) {
788788
})
789789

790790
// This test fails when run with -race when it's not threadsafe
791-
t.Run("it is threadsafe", func(t *testing.T) {
791+
t.Run("it is threadsafe", func(_ *testing.T) {
792792
start := make(chan struct{})
793793
end := make(chan struct{})
794794

@@ -889,7 +889,7 @@ func TestOptions(t *testing.T) {
889889
"Thing1": "1",
890890
}
891891

892-
toError := func(i interface{}) (interface{}, error) {
892+
toError := func(_ interface{}) (interface{}, error) {
893893
return nil, errors.New("something bad")
894894
}
895895

experimental/e2e/fixture/fixture_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func TestFixtureMatch(t *testing.T) {
9090
store := newFakeStorage()
9191
_ = store.Load()
9292
f := fixture.NewFixture(store)
93-
f.WithMatcher(func(res *http.Request) *http.Response {
93+
f.WithMatcher(func(_ *http.Request) *http.Response {
9494
return nil
9595
})
9696
res := f.Match(store.entries[0].Request) // nolint:bodyclose

experimental/macros/time_macros.go

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

1111
func FromMacro(inputString string, timeRange backend.TimeRange) (string, error) {
12-
res, err := applyMacro("$$from", inputString, func(query string, args []string) (string, error) {
12+
res, err := applyMacro("$$from", inputString, func(_ string, args []string) (string, error) {
1313
return expandTimeMacro(timeRange.From, args)
1414
})
1515
return res, err
1616
}
1717

1818
func ToMacro(inputString string, timeRange backend.TimeRange) (string, error) {
19-
res, err := applyMacro("$$to", inputString, func(query string, args []string) (string, error) {
19+
res, err := applyMacro("$$to", inputString, func(_ string, args []string) (string, error) {
2020
return expandTimeMacro(timeRange.To, args)
2121
})
2222
return res, err

experimental/mock/roundtripper_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func TestRoundTripper_RoundTrip(t *testing.T) {
164164
{
165165
name: "should skip GetResponse when nil values returned",
166166
rt: &mock.RoundTripper{
167-
GetResponse: func(req *http.Request) (*http.Response, error) {
167+
GetResponse: func(_ *http.Request) (*http.Response, error) {
168168
return nil, nil
169169
},
170170
Body: "default body",

0 commit comments

Comments
 (0)