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

Method Clone

pkg/cmd/pr/shared/editable.go:291–309  ·  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

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

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected