code: func (m *GormIdentityRepository) First(funcs ...func(*gorm.DB) *gorm.DB) (*Identity, error) {
  	defer goa.MeasureSince([]string{"goa", "db", "identity", "first"}, time.Now())
  	var objs []*Identity
  	log.Debug(nil, nil, "Looking for identity matching: %v", funcs)
  
  	err := m.db.Scopes(funcs...).Table(m.TableName()).First(&objs).Error
  	if err != nil && err != gorm.ErrRecordNotFound {
  		return nil, errs.WithStack(err)
  	}
  	if len(objs) != 0 && objs[0] != nil {
  		log.Debug(nil, map[string]interface{}{
  			"identity_list": objs,
  		}, "Found matching identity: %v", *objs[0])
  		return objs[0], nil
  	}
  	log.Debug(nil, map[string]interface{}{
  		"identity_list": objs,
  	}, "No matching identity found")
  	return nil, nil
  }
docs: // First returns the first Identity element that matches the given criteria