Added a stack overflow safe recursive variation of FindLastChildNode

Old method deprecated.

Signed-off-by: Dave Shanley <dave@quobix.com>
This commit is contained in:
Dave Shanley
2023-04-30 07:58:46 -04:00
parent dcfb480095
commit 8549b1547a
3 changed files with 937 additions and 893 deletions

View File

@@ -321,12 +321,10 @@ func (n *NodeBuilder) AddYAMLNode(parent *yaml.Node, entry *NodeEntry) *yaml.Nod
break
case reflect.Float64:
precision := -1
if entry.StringValue != "" && strings.Contains(entry.StringValue, ".") {
precision = len(strings.Split(fmt.Sprint(entry.StringValue), ".")[1])
}
val := strconv.FormatFloat(value.(float64), 'f', precision, 64)
valueNode = utils.CreateFloatNode(val)
valueNode.Line = line

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff