mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 05:38:04 +00:00
Fixed bad line entry for #1422
This commit is contained in:
parent
b202ccc5dc
commit
cb609a1886
@ -268,7 +268,10 @@ func parseSnippet(value string) (*yaml.Node, error) {
|
||||
if len(parsedNode.Node.Content) == 0 {
|
||||
return nil, fmt.Errorf("bad data")
|
||||
}
|
||||
return unwrapDoc(parsedNode.Node), err
|
||||
result := unwrapDoc(parsedNode.Node)
|
||||
result.Line = 0
|
||||
result.Column = 0
|
||||
return result, err
|
||||
}
|
||||
|
||||
func recursiveNodeEqual(lhs *yaml.Node, rhs *yaml.Node) bool {
|
||||
|
@ -38,8 +38,8 @@ var parseSnippetScenarios = []parseSnippetScenario{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!null",
|
||||
Value: "null",
|
||||
Line: 1,
|
||||
Column: 1,
|
||||
Line: 0,
|
||||
Column: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -48,8 +48,8 @@ var parseSnippetScenarios = []parseSnippetScenario{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!int",
|
||||
Value: "3",
|
||||
Line: 1,
|
||||
Column: 1,
|
||||
Line: 0,
|
||||
Column: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -58,8 +58,8 @@ var parseSnippetScenarios = []parseSnippetScenario{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!str",
|
||||
Value: "cat",
|
||||
Line: 1,
|
||||
Column: 1,
|
||||
Line: 0,
|
||||
Column: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -68,8 +68,8 @@ var parseSnippetScenarios = []parseSnippetScenario{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!float",
|
||||
Value: "3.1",
|
||||
Line: 1,
|
||||
Column: 1,
|
||||
Line: 0,
|
||||
Column: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -78,8 +78,8 @@ var parseSnippetScenarios = []parseSnippetScenario{
|
||||
Kind: yaml.ScalarNode,
|
||||
Tag: "!!bool",
|
||||
Value: "true",
|
||||
Line: 1,
|
||||
Column: 1,
|
||||
Line: 0,
|
||||
Column: 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user