From ab1724edbf5f7ac238669945d4d672c465e93e5e Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 18 Jan 2023 00:14:59 -0500 Subject: [PATCH] Variable naming. --- pkg/service/presentation/service.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/service/presentation/service.go b/pkg/service/presentation/service.go index fde55720c..866d4769b 100644 --- a/pkg/service/presentation/service.go +++ b/pkg/service/presentation/service.go @@ -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