Skip to content

Commit

Permalink
Fix golangci-linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
osamingo committed May 1, 2023
1 parent 24ad20c commit 6301dbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type (
}
)

func (h EchoHandler) ServeJSONRPC(c context.Context, params *json.RawMessage) (interface{}, *jsonrpc.Error) {
func (h EchoHandler) ServeJSONRPC(_ context.Context, params *json.RawMessage) (interface{}, *jsonrpc.Error) {

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 32 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)
var p EchoParams
if err := jsonrpc.Unmarshal(params, &p); err != nil {
return nil, err
Expand All @@ -40,7 +40,7 @@ func (h EchoHandler) ServeJSONRPC(c context.Context, params *json.RawMessage) (i
}, nil
}

func (h PositionalHandler) ServeJSONRPC(c context.Context, params *json.RawMessage) (interface{}, *jsonrpc.Error) {
func (h PositionalHandler) ServeJSONRPC(_ context.Context, params *json.RawMessage) (interface{}, *jsonrpc.Error) {

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)

Check failure on line 43 in example_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: jsonrpc (typecheck)
var p PositionalParams
if err := jsonrpc.Unmarshal(params, &p); err != nil {
return nil, err
Expand Down
2 changes: 0 additions & 2 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func (f HandlerFunc) ServeJSONRPC(c context.Context, params *json.RawMessage) (a
func (mr *MethodRepository) ServeHTTP(w http.ResponseWriter, r *http.Request) {
rs, batch, err := ParseRequest(r)
if err != nil {
//nolint: contextcheck
err := SendResponse(w, []*Response{
{
Version: Version,
Expand All @@ -48,7 +47,6 @@ func (mr *MethodRepository) ServeHTTP(w http.ResponseWriter, r *http.Request) {
resp[i] = mr.InvokeMethod(r.Context(), rs[i])
}

//nolint: contextcheck
if err := SendResponse(w, resp, batch); err != nil {
fmt.Fprint(w, "Failed to encode result objects")
w.WriteHeader(http.StatusInternalServerError)
Expand Down

0 comments on commit 6301dbd

Please sign in to comment.