code: func (r *GormWorkItemLinkRepository) DeleteRelatedLinks(ctx context.Context, wiID uuid.UUID, suppressorID uuid.UUID) error {
  	defer goa.MeasureSince([]string{"goa", "db", "workitemlink", "deleteRelatedLinks"}, time.Now())
  	log.Info(ctx, map[string]interface{}{
  		"wi_id": wiID,
  	}, "Deleting the links related to work item")
  	var workitemLinks = []WorkItemLink{}
  	r.db.Where("? in (source_id, target_id)", wiID).Find(&workitemLinks)
  	// delete one by one to trigger the creation of a new work item link revision
  	locked := false
  	for _, workitemLink := range workitemLinks {
  		if !locked {
  			wiRepo := workitem.NewWorkItemRepository(r.db)
  			src, err := wiRepo.LoadByID(ctx, workitemLink.SourceID)
  			if err != nil {
  				return errs.Wrapf(err, "failed to load source work item for: %s", workitemLink.SourceID)
  			}
  			if err := r.acquireLock(src.SpaceID); err != nil {
  				return errs.Wrap(err, "failed to acquire lock during link deletion")
  			}
  			locked = true
  		}
  		r.deleteLink(ctx, workitemLink, suppressorID)
  	}
  	return nil
  }
docs: // DeleteRelatedLinks deletes all links in which the source or target equals the
  // given work item ID.