Marshalling bug because func (n *MappingValueNode) toString()
Doesn't have case for tag nodes.
#533
Labels
func (n *MappingValueNode) toString()
Doesn't have case for tag nodes.
#533
Describe the bug
Local tags for scalar nodes are placed on a new line because
toString()
forMappingValueNode
doesn't have a case for when .value is TagNodeTo Reproduce
https://go.dev/play/p/6_AgHpB8WFs
Expected behavior
Relates to function at line 1355 in
go-yaml/ast/ast.go
Line 1355 in 2c6a0e7
If toString() had a case for TagNode and returned
return fmt.Sprintf("%s%s: %s", space, n.Key.String(), n.Value.String())
(no new line in format string) for when
_, ok := n.Value.(*TagNode); ok
then the node would be marshalled correctly.
Screenshots
If applicable, add screenshots to help explain your problem.
Version Variables
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: