mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 12:37:48 +00:00
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:
@@ -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
|
||||
|
||||
875
utils/utils.go
875
utils/utils.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user