hcl/hclsyntax: return hcl.TraverseIndex, not pointer to one
Traversals are always passed by value, so returning a pointer here is inconsistent with how hcl.TraverseIndex is used elsewhere and thus makes life inconvenient for callers making type assertions.
This commit is contained in:
parent
883a81b490
commit
0daeda39ff
@ -627,7 +627,7 @@ Traversal:
|
|||||||
if lit, isLit := keyExpr.(*LiteralValueExpr); isLit {
|
if lit, isLit := keyExpr.(*LiteralValueExpr); isLit {
|
||||||
litKey, _ := lit.Value(nil)
|
litKey, _ := lit.Value(nil)
|
||||||
rng := hcl.RangeBetween(open.Range, close.Range)
|
rng := hcl.RangeBetween(open.Range, close.Range)
|
||||||
step := &hcl.TraverseIndex{
|
step := hcl.TraverseIndex{
|
||||||
Key: litKey,
|
Key: litKey,
|
||||||
SrcRange: rng,
|
SrcRange: rng,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user