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

Method Clone

pkg/cmd/pr/shared/editable.go:292–310  ·  view source on GitHub ↗

Clone creates a mostly-shallow copy of Editable suitable for use in parallel go routines. Fields that would be mutated will be copied.

()

Source from the content-addressed store, hash-verified

290// Clone creates a mostly-shallow copy of Editable suitable for use in parallel
291// go routines. Fields that would be mutated will be copied.
292func (e *Editable) Clone() Editable {
293 return Editable{
294 Title: e.Title.clone(),
295 Body: e.Body.clone(),
296 Base: e.Base.clone(),
297 Reviewers: e.Reviewers.clone(),
298 ReviewerSearchFunc: e.ReviewerSearchFunc,
299 Assignees: e.Assignees.clone(),
300 AssigneeSearchFunc: e.AssigneeSearchFunc,
301 Labels: e.Labels.clone(),
302 Projects: e.Projects.clone(),
303 Milestone: e.Milestone.clone(),
304 IssueType: e.IssueType.clone(),
305 IssueTypeNameToID: e.IssueTypeNameToID,
306 ApiActorsSupported: e.ApiActorsSupported,
307 // Shallow copy since no mutation.
308 Metadata: e.Metadata,
309 }
310}
311
312func (es *EditableString) clone() EditableString {
313 return EditableString{

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected