MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / deepCopyYAMLNode

Function deepCopyYAMLNode

internal/pluginhost/config.go:205–217  ·  view source on GitHub ↗
(node *yaml.Node)

Source from the content-addressed store, hash-verified

203}
204
205func deepCopyYAMLNode(node *yaml.Node) *yaml.Node {
206 if node == nil {
207 return nil
208 }
209 copyNode := *node
210 if len(node.Content) > 0 {
211 copyNode.Content = make([]*yaml.Node, 0, len(node.Content))
212 for _, child := range node.Content {
213 copyNode.Content = append(copyNode.Content, deepCopyYAMLNode(child))
214 }
215 }
216 return &copyNode
217}
218
219func mustMarshalYAML(v any) []byte {
220 raw, errMarshal := yaml.Marshal(v)

Callers 1

normalizedConfigNodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected