func enrichLinkList(ctx *workItemLinkContext, linkArr *app.WorkItemLinkList) error {

	// include link types
	typeDataArr, err := getTypesOfLinks(ctx, linkArr.Data)
	if err != nil {
		return errs.WithStack(err)
	}
	// Convert slice of objects to slice of interface (see https://golang.org/doc/faq#convert_slice_of_interface)
	interfaceArr := make([]interface{}, len(typeDataArr))
	for i, v := range typeDataArr {
		interfaceArr[i] = v
	}
	linkArr.Included = append(linkArr.Included, interfaceArr...)

	// include link categories
	catDataArr, err := getCategoriesOfLinkTypes(ctx, typeDataArr)
	if err != nil {
		return errs.WithStack(err)
	}
	// Convert slice of objects to slice of interface (see https://golang.org/doc/faq#convert_slice_of_interface)
	interfaceArr = make([]interface{}, len(catDataArr))
	for i, v := range catDataArr {
		interfaceArr[i] = v
	}
	linkArr.Included = append(linkArr.Included, interfaceArr...)

	// TODO(kwk): Include WIs from source and target
	workItemDataArr, err := getWorkItemsOfLinks(ctx, linkArr.Data)
	if err != nil {
		return errs.WithStack(err)
	}
	// Convert slice of objects to slice of interface (see https://golang.org/doc/faq#convert_slice_of_interface)
	interfaceArr = make([]interface{}, len(workItemDataArr))
	for i, v := range workItemDataArr {
		interfaceArr[i] = v
	}
	linkArr.Included = append(linkArr.Included, interfaceArr...)

	// TODO(kwk): Include WITs (once #559 is merged)

	// Add links to individual link data element
	for _, link := range linkArr.Data {
		selfURL := rest.AbsoluteURL(ctx.RequestData, ctx.LinkFunc(*link.ID))
		link.Links = &app.GenericLinks{
			Self: &selfURL,
		}
	}
	return nil
}
// enrichLinkList includes related resources in the linkArr's "included" element
enrichLinkList includes related resources in the linkArr's "included" element
// enrichLinkList includes related resources in the linkArr ' s " included " element
func enrichLinkList(ctx *workItemLinkContext, linkArr *app.WorkItemLinkList) error {
	typeDataArr, err := getTypesOfLinks(ctx, linkArr.Data)
	if err != nil {
		return errs.WithStack(err)
	}
	interfaceArr := make([]interface{}, len(typeDataArr))
	for i, v := range typeDataArr {
		interfaceArr[i] = v
	}
	linkArr.Included = append(linkArr.Included, interfaceArr...)
	catDataArr, err := getCategoriesOfLinkTypes(ctx, typeDataArr)
	if err != nil {
		return errs.WithStack(err)
	}
	interfaceArr = make([]interface{}, len(catDataArr))
	for i, v := range catDataArr {
		interfaceArr[i] = v
	}
	linkArr.Included = append(linkArr.Included, interfaceArr...)
	workItemDataArr, err := getWorkItemsOfLinks(ctx, linkArr.Data)
	if err != nil {
		return errs.WithStack(err)
	}
	interfaceArr = make([]interface{}, len(workItemDataArr))
	for i, v := range workItemDataArr {
		interfaceArr[i] = v
	}
	linkArr.Included = append(linkArr.Included, interfaceArr...)
	for _, link := range linkArr.Data {
		selfURL := rest.AbsoluteURL(ctx.RequestData, ctx.LinkFunc(*link.ID))
		link.Links = &app.GenericLinks{
			Self: &selfURL,
		}
	}
	return nil
}
func enrichLinkList ( ctx * workItemLinkContext , linkArr * app . WorkItemLinkList ) error { typeDataArr , err := getTypesOfLinks ( ctx , linkArr . Data ) if err != nil { return errs . WithStack ( err ) } interfaceArr := make ( [ ] interface { } , len ( typeDataArr ) ) for i , v := range typeDataArr { interfaceArr [ i ] = v } linkArr . Included = append ( linkArr . Included , interfaceArr ... ) catDataArr , err := getCategoriesOfLinkTypes ( ctx , typeDataArr ) if err != nil { return errs . WithStack ( err ) } interfaceArr = make ( [ ] interface { } , len ( catDataArr ) ) for i , v := range catDataArr { interfaceArr [ i ] = v } linkArr . Included = append ( linkArr . Included , interfaceArr ... ) workItemDataArr , err := getWorkItemsOfLinks ( ctx , linkArr . Data ) if err != nil { return errs . WithStack ( err ) } interfaceArr = make ( [ ] interface { } , len ( workItemDataArr ) ) for i , v := range workItemDataArr { interfaceArr [ i ] = v } linkArr . Included = append ( linkArr . Included , interfaceArr ... ) for _ , link := range linkArr . Data { selfURL := rest . AbsoluteURL ( ctx . RequestData , ctx . LinkFunc ( * link . ID ) ) link . Links = & app . GenericLinks { Self : & selfURL , } } return nil }
enrichLinkList includes related resources in the linkArr's "included" element
enrichLinkList includes related resources in the linkArr ' s " included " element
// include link types // Convert slice of objects to slice of interface (see https://golang.org/doc/faq#convert_slice_of_interface) // include link categories // Convert slice of objects to slice of interface (see https://golang.org/doc/faq#convert_slice_of_interface) // TODO(kwk): Include WIs from source and target // Convert slice of objects to slice of interface (see https://golang.org/doc/faq#convert_slice_of_interface) // TODO(kwk): Include WITs (once #559 is merged) // Add links to individual link data element