MCPcopy Create free account
hub / github.com/docker/docker-agent / cloneSchemaValue

Function cloneSchemaValue

pkg/session/session.go:523–540  ·  view source on GitHub ↗
(v any)

Source from the content-addressed store, hash-verified

521}
522
523func cloneSchemaValue(v any) any {
524 switch x := v.(type) {
525 case map[string]any:
526 cp := make(map[string]any, len(x))
527 for k, v := range x {
528 cp[k] = cloneSchemaValue(v)
529 }
530 return cp
531 case []any:
532 cp := make([]any, len(x))
533 for i, v := range x {
534 cp[i] = cloneSchemaValue(v)
535 }
536 return cp
537 default:
538 return v
539 }
540}
541
542// Session helper methods
543

Callers 1

cloneToolDefinitionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected