Skip to content

Commit

Permalink
refactor: rename local variables to match Go codestyle (#3100)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed May 26, 2024
1 parent 834d832 commit d7447c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions api/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ func Generate(cfg *config.Config, option ...Option) error {
}
}
// Merge again now that the generated models have been injected into the typemap
data_plugins := make([]any, len(plugins))
dataPlugins := make([]any, len(plugins))
for index := range plugins {
data_plugins[index] = plugins[index]
dataPlugins[index] = plugins[index]
}
data, err := codegen.BuildData(cfg, data_plugins...)
data, err := codegen.BuildData(cfg, dataPlugins...)
if err != nil {
return fmt.Errorf("merging type systems failed: %w", err)
}
Expand Down
8 changes: 4 additions & 4 deletions graphql/handler/transport/http_form_urlencoded.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ func (h UrlEncodedForm) Do(w http.ResponseWriter, r *http.Request, exec graphql.
return
}

rc, OpErr := exec.CreateOperationContext(ctx, params)
if OpErr != nil {
w.WriteHeader(statusFor(OpErr))
resp := exec.DispatchError(graphql.WithOperationContext(ctx, rc), OpErr)
rc, opErr := exec.CreateOperationContext(ctx, params)
if opErr != nil {
w.WriteHeader(statusFor(opErr))
resp := exec.DispatchError(graphql.WithOperationContext(ctx, rc), opErr)
writeJson(w, resp)
return
}
Expand Down
8 changes: 4 additions & 4 deletions graphql/handler/transport/http_graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func (h GRAPHQL) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphEx
return
}

rc, OpErr := exec.CreateOperationContext(ctx, params)
if OpErr != nil {
w.WriteHeader(statusFor(OpErr))
resp := exec.DispatchError(graphql.WithOperationContext(ctx, rc), OpErr)
rc, opErr := exec.CreateOperationContext(ctx, params)
if opErr != nil {
w.WriteHeader(statusFor(opErr))
resp := exec.DispatchError(graphql.WithOperationContext(ctx, rc), opErr)
writeJson(w, resp)
return
}
Expand Down
8 changes: 4 additions & 4 deletions graphql/handler/transport/http_post.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ func (h POST) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphExecu
return
}

rc, OpErr := exec.CreateOperationContext(ctx, params)
if OpErr != nil {
w.WriteHeader(statusFor(OpErr))
resp := exec.DispatchError(graphql.WithOperationContext(ctx, rc), OpErr)
rc, opErr := exec.CreateOperationContext(ctx, params)
if opErr != nil {
w.WriteHeader(statusFor(opErr))
resp := exec.DispatchError(graphql.WithOperationContext(ctx, rc), opErr)
writeJson(w, resp)
return
}
Expand Down

0 comments on commit d7447c6

Please sign in to comment.