From 9ab737ca10556e9e45e5f0f781d9e0b321c04f78 Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Wed, 6 Mar 2024 10:33:20 -0800 Subject: [PATCH 1/2] enable nilness linter --- tools/configs/golangci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/configs/golangci.yaml b/tools/configs/golangci.yaml index 1b6b76aa37..e8fe63a1fc 100644 --- a/tools/configs/golangci.yaml +++ b/tools/configs/golangci.yaml @@ -287,6 +287,7 @@ linters-settings: # run `go tool vet help` to see all analyzers enable: - atomicalign + - nilness enable-all: false From f2d95da702587b091d1f024e4bcd653455bf016b Mon Sep 17 00:00:00 2001 From: Keenan Nemetz Date: Wed, 6 Mar 2024 10:33:27 -0800 Subject: [PATCH 2/2] fix linter errors --- http/handler_lens.go | 4 ---- request/graphql/parser/request.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/http/handler_lens.go b/http/handler_lens.go index cb69a691fe..532eaacefc 100644 --- a/http/handler_lens.go +++ b/http/handler_lens.go @@ -88,10 +88,6 @@ func (s *lensHandler) MigrateDown(rw http.ResponseWriter, req *http.Request) { responseJSON(rw, http.StatusBadRequest, errorResponse{err}) return } - if err != nil { - responseJSON(rw, http.StatusBadRequest, errorResponse{err}) - return - } var value []map[string]any err = enumerable.ForEach(result, func(item map[string]any) { value = append(value, item) diff --git a/request/graphql/parser/request.go b/request/graphql/parser/request.go index fca63bcac5..69d275de03 100644 --- a/request/graphql/parser/request.go +++ b/request/graphql/parser/request.go @@ -48,7 +48,7 @@ func ParseRequest(schema gql.Schema, doc *ast.Document) (*request.Request, []err } parsedDirectives, err := parseDirectives(astOpDef.Directives) - if errs != nil { + if err != nil { return nil, []error{err} } parsedQueryOpDef.Directives = parsedDirectives