diff options
| author | Shulhan <ms@kilabit.info> | 2024-02-15 02:35:41 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-02-15 22:10:58 +0700 |
| commit | c14c0aada8812f5540b9e2e27ad82b91e384d228 (patch) | |
| tree | 590ca6f0ae1361e54de723fde63d906243de90e9 /lib/http | |
| parent | 6ef5bdfc203a5d5e3648c59edd158db51ee289c0 (diff) | |
| download | pakakeh.go-c14c0aada8812f5540b9e2e27ad82b91e384d228.tar.xz | |
all: set unused parameter to "_"
Diffstat (limited to 'lib/http')
| -rw-r--r-- | lib/http/http_test.go | 4 | ||||
| -rw-r--r-- | lib/http/server_test.go | 8 | ||||
| -rw-r--r-- | lib/http/sse_endpoint_test.go | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/http/http_test.go b/lib/http/http_test.go index caceedf2..d846ca2e 100644 --- a/lib/http/http_test.go +++ b/lib/http/http_test.go @@ -28,7 +28,7 @@ var ( client = &http.Client{} - cbNone = func(epr *EndpointRequest) ([]byte, error) { + cbNone = func(_ *EndpointRequest) ([]byte, error) { return nil, nil } @@ -140,7 +140,7 @@ func registerEndpoints() { err = testServer.RegisterEndpoint(&Endpoint{ Path: "/download", ResponseType: ResponseTypePlain, - Call: func(epr *EndpointRequest) ([]byte, error) { + Call: func(_ *EndpointRequest) ([]byte, error) { return testDownloadBody, nil }, }) diff --git a/lib/http/server_test.go b/lib/http/server_test.go index 8a2ef81e..5a0d7ddc 100644 --- a/lib/http/server_test.go +++ b/lib/http/server_test.go @@ -182,7 +182,7 @@ func TestRegisterDelete(t *testing.T) { } } -var testEvaluator = func(req *http.Request, reqBody []byte) error { +var testEvaluator = func(req *http.Request, _ []byte) error { k := req.Form.Get("k") if len(k) == 0 { @@ -662,16 +662,16 @@ func TestServeHTTPOptions(t *testing.T) { func TestStatusError(t *testing.T) { var ( - cbError = func(epr *EndpointRequest) ([]byte, error) { + cbError = func(_ *EndpointRequest) ([]byte, error) { return nil, &liberrors.E{ Code: http.StatusLengthRequired, Message: `Length required`, } } - cbNoCode = func(epr *EndpointRequest) ([]byte, error) { + cbNoCode = func(_ *EndpointRequest) ([]byte, error) { return nil, liberrors.Internal(nil) } - cbCustomErr = func(epr *EndpointRequest) ([]byte, error) { + cbCustomErr = func(_ *EndpointRequest) ([]byte, error) { return nil, fmt.Errorf("Custom error") } diff --git a/lib/http/sse_endpoint_test.go b/lib/http/sse_endpoint_test.go index 106149b6..2f3ebbda 100644 --- a/lib/http/sse_endpoint_test.go +++ b/lib/http/sse_endpoint_test.go @@ -46,7 +46,7 @@ func testSSEEndpointEmptyCall(t *testing.T, httpd *Server) { func testSSEEndpointDuplicatePath(t *testing.T, httpd *Server) { var ep = &Endpoint{ Path: `/sse`, - Call: func(req *EndpointRequest) ([]byte, error) { return nil, nil }, + Call: func(_ *EndpointRequest) ([]byte, error) { return nil, nil }, } var err = httpd.RegisterEndpoint(ep) @@ -56,7 +56,7 @@ func testSSEEndpointDuplicatePath(t *testing.T, httpd *Server) { var sse = &SSEEndpoint{ Path: `/sse`, - Call: func(sseconn *SSEConn) {}, + Call: func(_ *SSEConn) {}, } err = httpd.RegisterSSE(sse) |
