Skip to content

Commit

Permalink
ignore unused params in functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kpacha committed Sep 10, 2024
1 parent 4072fa5 commit 4dab457
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func TestProxyFactory(t *testing.T) {
}

dummyProxyFactory := proxy.FactoryFunc(func(_ *config.EndpointConfig) (proxy.Proxy, error) {
return func(ctx context.Context, req *proxy.Request) (*proxy.Response, error) {
return func(_ context.Context, req *proxy.Request) (*proxy.Response, error) {
if req.Method != "POST" {
t.Errorf("unexpected method %s", req.Method)
}
Expand Down Expand Up @@ -446,7 +446,7 @@ func Test_Issue7(t *testing.T) {
json.Unmarshal([]byte(response), &r)

dummyProxyFactory := proxy.FactoryFunc(func(_ *config.EndpointConfig) (proxy.Proxy, error) {
return func(ctx context.Context, req *proxy.Request) (*proxy.Response, error) {
return func(_ context.Context, _ *proxy.Request) (*proxy.Response, error) {
return &proxy.Response{
Data: r,
Metadata: proxy.Metadata{
Expand Down Expand Up @@ -518,7 +518,7 @@ func Test_jsonNumber(t *testing.T) {
encoding.JSONDecoder(strings.NewReader(response), &r)

dummyProxyFactory := proxy.FactoryFunc(func(_ *config.EndpointConfig) (proxy.Proxy, error) {
return func(ctx context.Context, req *proxy.Request) (*proxy.Response, error) {
return func(_ context.Context, _ *proxy.Request) (*proxy.Response, error) {
return &proxy.Response{
Data: r,
Metadata: proxy.Metadata{
Expand Down Expand Up @@ -594,7 +594,7 @@ func Test_keyValConverter(t *testing.T) {
}

dummyProxyFactory := proxy.FactoryFunc(func(_ *config.EndpointConfig) (proxy.Proxy, error) {
return func(ctx context.Context, req *proxy.Request) (*proxy.Response, error) {
return func(_ context.Context, _ *proxy.Request) (*proxy.Response, error) {
return &proxy.Response{
Data: r,
Metadata: proxy.Metadata{
Expand Down Expand Up @@ -674,7 +674,7 @@ func Test_listGrowsWhenUpperIndexOutOfBound(t *testing.T) {
r := map[string]interface{}{}

dummyProxyFactory := proxy.FactoryFunc(func(_ *config.EndpointConfig) (proxy.Proxy, error) {
return func(ctx context.Context, req *proxy.Request) (*proxy.Response, error) {
return func(_ context.Context, _ *proxy.Request) (*proxy.Response, error) {
return &proxy.Response{
Data: r,
Metadata: proxy.Metadata{
Expand Down
6 changes: 3 additions & 3 deletions router/gin/lua_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestHandlerFactory_error(t *testing.T) {
}

hf := func(_ *config.EndpointConfig, _ proxy.Proxy) gin.HandlerFunc {
return func(c *gin.Context) {
return func(_ *gin.Context) {
t.Error("the handler shouldn't be executed")
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@ func TestHandlerFactory_errorHTTP(t *testing.T) {
}

hf := func(_ *config.EndpointConfig, _ proxy.Proxy) gin.HandlerFunc {
return func(c *gin.Context) {
return func(_ *gin.Context) {
t.Error("the handler shouldn't be executed")
}
}
Expand Down Expand Up @@ -164,7 +164,7 @@ func TestHandlerFactory_errorHTTPWithContentType(t *testing.T) {
}

hf := func(_ *config.EndpointConfig, _ proxy.Proxy) gin.HandlerFunc {
return func(c *gin.Context) {
return func(_ *gin.Context) {
t.Error("the handler shouldn't be executed")
}
}
Expand Down
8 changes: 4 additions & 4 deletions router/mux/lua_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestHandlerFactory(t *testing.T) {
}

hf := func(_ *config.EndpointConfig, _ proxy.Proxy) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
return func(_ http.ResponseWriter, r *http.Request) {
if URL := r.URL.String(); URL != "/some-path/42?extra=foo&id=1&more=true" {
t.Errorf("unexpected URL: %s", URL)
}
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestHandlerFactory_error(t *testing.T) {
}

hf := func(_ *config.EndpointConfig, _ proxy.Proxy) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
return func(_ http.ResponseWriter, _ *http.Request) {
t.Error("the handler shouldn't be executed")
}
}
Expand Down Expand Up @@ -120,7 +120,7 @@ func TestHandlerFactory_errorHTTP(t *testing.T) {
}

hf := func(_ *config.EndpointConfig, _ proxy.Proxy) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
return func(_ http.ResponseWriter, _ *http.Request) {
t.Error("the handler shouldn't be executed")
}
}
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestHandlerFactory_errorHTTPWithContentType(t *testing.T) {
}

hf := func(_ *config.EndpointConfig, _ proxy.Proxy) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
return func(_ http.ResponseWriter, _ *http.Request) {
t.Error("the handler shouldn't be executed")
}
}
Expand Down

0 comments on commit 4dab457

Please sign in to comment.