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

Function cloneJSON

script/ghmock/restscaffold.go:360–370  ·  view source on GitHub ↗
(v any)

Source from the content-addressed store, hash-verified

358}
359
360func cloneJSON(v any) any {
361 data, err := json.Marshal(v)
362 if err != nil {
363 return v
364 }
365 var copied any
366 if err := json.Unmarshal(data, &copied); err != nil {
367 return v
368 }
369 return copied
370}
371
372func alternatives(s *openapi3.Schema) openapi3.SchemaRefs {
373 return append(append(openapi3.SchemaRefs{}, s.OneOf...), s.AnyOf...)

Callers 2

pickExampleFunction · 0.85
fillMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected