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:
Martin Atkins 2018-01-18 08:12:05 -08:00
parent 883a81b490
commit 0daeda39ff

View File

@ -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,
} }