code: func (r *GormWorkItemLinkTypeRepository) Create(ctx context.Context, linkType WorkItemLinkType) (*WorkItemLinkType, error) {
  	defer goa.MeasureSince([]string{"goa", "db", "workitemlinktype", "create"}, time.Now())
  	if err := linkType.CheckValidForCreation(); err != nil {
  		log.Error(ctx, map[string]interface{}{
  			"wilt_id": linkType.ID.String(),
  			"err":     err,
  		}, "failed to validate link type")
  		return nil, errs.WithStack(err)
  	}
  	db := r.db.Create(&linkType)
  	if db.Error != nil {
  		if gormsupport.IsUniqueViolation(db.Error, "work_item_link_types_name_idx") {
  			log.Error(ctx, map[string]interface{}{
  				"err":               db.Error,
  				"space_template_id": linkType.SpaceTemplateID,
  				"wilt_name":         linkType.Name,
  			}, "unable to create work item link type because a link already exists with the same space_template_id and name")
  			return nil, errors.NewDataConflictError(fmt.Sprintf("work item link type already exists with the same space_template_id: %s; name: %s ", linkType.SpaceTemplateID, linkType.Name))
  		}
  		log.Error(ctx, map[string]interface{}{
  			"wilt_id": linkType.ID.String(),
  			"err":     db.Error,
  		}, "failed to create work item link type")
  		return nil, errors.NewInternalError(ctx, errs.Wrap(db.Error, "failed to create link type"))
  	}
  	log.Info(ctx, map[string]interface{}{
  		"wilt_id": linkType.ID.String(),
  	}, "created work item link type")
  	return &linkType, nil
  }
docs: // Create creates a new work item link type in the repository.
  // Returns BadParameterError, ConversionError or InternalError