mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-10 00:05:38 +00:00
encoder_lua: Improve Tag handling robustness
Using the method call seems more reliable in case the input parser forgets to set the tag.
This commit is contained in:
parent
e709a583f4
commit
58a95948ca
@ -270,7 +270,7 @@ func (le *luaEncoder) encodeAny(writer io.Writer, node *yaml.Node) error {
|
|||||||
case yaml.MappingNode:
|
case yaml.MappingNode:
|
||||||
return le.encodeMap(writer, node, false)
|
return le.encodeMap(writer, node, false)
|
||||||
case yaml.ScalarNode:
|
case yaml.ScalarNode:
|
||||||
switch node.Tag {
|
switch node.ShortTag() {
|
||||||
case "!!str":
|
case "!!str":
|
||||||
return le.encodeString(writer, node)
|
return le.encodeString(writer, node)
|
||||||
case "!!null":
|
case "!!null":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user