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

Function removeMapKey

internal/config/config.go:1799–1809  ·  view source on GitHub ↗
(mapNode *yaml.Node, key string)

Source from the content-addressed store, hash-verified

1797}
1798
1799func removeMapKey(mapNode *yaml.Node, key string) {
1800 if mapNode == nil || mapNode.Kind != yaml.MappingNode || key == "" {
1801 return
1802 }
1803 for i := 0; i+1 < len(mapNode.Content); i += 2 {
1804 if mapNode.Content[i] != nil && mapNode.Content[i].Value == key {
1805 mapNode.Content = append(mapNode.Content[:i], mapNode.Content[i+2:]...)
1806 return
1807 }
1808 }
1809}
1810
1811func pruneMappingToGeneratedKeys(dstRoot, srcRoot *yaml.Node, keyPath ...string) {
1812 if len(keyPath) == 0 || dstRoot == nil || srcRoot == nil {

Calls

no outgoing calls

Tested by

no test coverage detected