mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-03 10:55:36 +00:00
Remove unused hasStructuralChildren method from tomlEncoder
Agent-Logs-Url: https://github.com/mikefarah/yq/sessions/2c234b77-28e9-4995-ba6f-9d213ec551a0 Co-authored-by: mikefarah <1151925+mikefarah@users.noreply.github.com>
This commit is contained in:
parent
a297c15eb5
commit
320b0dee7f
@ -533,29 +533,6 @@ func (te *tomlEncoder) encodeSeparateMapping(w io.Writer, path []string, m *Cand
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (te *tomlEncoder) hasStructuralChildren(m *CandidateNode) bool {
|
|
||||||
for i := 0; i < len(m.Content); i += 2 {
|
|
||||||
v := m.Content[i+1]
|
|
||||||
// Only consider it structural if mapping has EncodeHintSeparateBlock
|
|
||||||
if v.Kind == MappingNode && v.EncodeHint == EncodeHintSeparateBlock {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if v.Kind == SequenceNode {
|
|
||||||
allMaps := true
|
|
||||||
for _, it := range v.Content {
|
|
||||||
if it.Kind != MappingNode {
|
|
||||||
allMaps = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if allMaps {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// encodeMappingBodyWithPath encodes attributes and nested arrays of tables using full dotted path context
|
// encodeMappingBodyWithPath encodes attributes and nested arrays of tables using full dotted path context
|
||||||
func (te *tomlEncoder) encodeMappingBodyWithPath(w io.Writer, path []string, m *CandidateNode) error {
|
func (te *tomlEncoder) encodeMappingBodyWithPath(w io.Writer, path []string, m *CandidateNode) error {
|
||||||
// First, attributes (scalars and non-map arrays)
|
// First, attributes (scalars and non-map arrays)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user