(mapNode *yaml.Node, key string)
| 1797 | } |
| 1798 | |
| 1799 | func 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 | |
| 1811 | func pruneMappingToGeneratedKeys(dstRoot, srcRoot *yaml.Node, keyPath ...string) { |
| 1812 | if len(keyPath) == 0 || dstRoot == nil || srcRoot == nil { |
no outgoing calls
no test coverage detected