Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
Variable naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
andresuribe87 committed Jan 18, 2023
1 parent 09841b5 commit ab1724e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/service/presentation/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,15 @@ func (s Service) ReviewSubmission(ctx context.Context, request model.ReviewSubmi
func (s Service) ListDefinitions(ctx context.Context) (*model.ListDefinitionsResponse, error) {
logrus.Debug("listing presentation definitions")

subs, err := s.storage.ListDefinitions(ctx)
defs, err := s.storage.ListDefinitions(ctx)
if err != nil {
return nil, errors.Wrap(err, "fetching definitions from storage")
}

resp := &model.ListDefinitionsResponse{Definitions: make([]*exchange.PresentationDefinition, 0, len(subs))}
for _, sub := range subs {
sub := sub // What's this?? see https://github.com/golang/go/wiki/CommonMistakes#using-reference-to-loop-iterator-variable
resp.Definitions = append(resp.Definitions, &sub.PresentationDefinition)
resp := &model.ListDefinitionsResponse{Definitions: make([]*exchange.PresentationDefinition, 0, len(defs))}
for _, def := range defs {
def := def // What's this?? see https://github.com/golang/go/wiki/CommonMistakes#using-reference-to-loop-iterator-variable
resp.Definitions = append(resp.Definitions, &def.PresentationDefinition)
}

return resp, nil
Expand Down

0 comments on commit ab1724e

Please sign in to comment.