From 0daeda39ffb73a40072a733deeaddca0eb46c9c4 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 18 Jan 2018 08:12:05 -0800 Subject: [PATCH] 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. --- hcl/hclsyntax/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hcl/hclsyntax/parser.go b/hcl/hclsyntax/parser.go index 0f81ddf..9d9f9f0 100644 --- a/hcl/hclsyntax/parser.go +++ b/hcl/hclsyntax/parser.go @@ -627,7 +627,7 @@ Traversal: if lit, isLit := keyExpr.(*LiteralValueExpr); isLit { litKey, _ := lit.Value(nil) rng := hcl.RangeBetween(open.Range, close.Range) - step := &hcl.TraverseIndex{ + step := hcl.TraverseIndex{ Key: litKey, SrcRange: rng, }