MCPcopy Create free account
hub / github.com/cli/cli / newAttachmentArgs

Function newAttachmentArgs

internal/attachments/attach.go:201–208  ·  view source on GitHub ↗

newAttachmentArgs describes each asset for the markdown half of the package, without a URL, since nothing has uploaded yet.

(assets []UserAsset)

Source from the content-addressed store, hash-verified

199// newAttachmentArgs describes each asset for the markdown half of the
200// package, without a URL, since nothing has uploaded yet.
201func newAttachmentArgs(assets []UserAsset) []attachmentArg {
202 args := make([]attachmentArg, len(assets))
203 for i, a := range assets {
204 f := a.getAsset()
205 args[i] = attachmentArg{Path: f.path, Alt: f.alt, RendersAsPlayer: a.rendersAsPlayer()}
206 }
207 return args
208}
209
210// attach points the document at the URLs of its attachments that uploaded,
211// given urls, which holds an empty string for each file that did not. The

Callers 1

newAttachableDocumentsFunction · 0.85

Calls 2

getAssetMethod · 0.65
rendersAsPlayerMethod · 0.65

Tested by

no test coverage detected