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