You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the offensive title, but I do not know how to describe it otherwise.
My issue is with this line: Node{Data: fmt.Sprintf("%v", v), Type: TextNode, level: level, value: fmt.Sprintf("%v", v)}
the result is that on text nodes Data and Value() both contains the exact same string representation of the underlying value. Meaning that in practice when I encounter a text node, to get its value if have to do node.Parent.Value().
So why not do: Node{Data: fmt.Sprintf("%v", v), Type: TextNode, level: level, value: v} ?
The text was updated successfully, but these errors were encountered:
Sorry for the offensive title, but I do not know how to describe it otherwise.
My issue is with this line:
Node{Data: fmt.Sprintf("%v", v), Type: TextNode, level: level, value: fmt.Sprintf("%v", v)}
the result is that on text nodes Data and Value() both contains the exact same string representation of the underlying value. Meaning that in practice when I encounter a text node, to get its value if have to do
node.Parent.Value()
.So why not do:
Node{Data: fmt.Sprintf("%v", v), Type: TextNode, level: level, value: v}
?The text was updated successfully, but these errors were encountered: