diff options
| author | Martin Atkins <mart@degeneration.co.uk> | 2018-12-14 11:33:28 -0800 |
|---|---|---|
| committer | Martin Atkins <mart@degeneration.co.uk> | 2018-12-14 11:33:28 -0800 |
| commit | 2934d2f0331a78c73667961dac9002a2de8da789 (patch) | |
| tree | d931bb9e574ec635136779804565e19b8aed4516 /cmd | |
| parent | e8dbb16dbc7f9774afd808c19a0fd40d2347191f (diff) | |
cmd/hclspecsuite: Generate correct ranges in diagnostic-diagnostics
We were taking a pointer to a for loop iterator variable and thus
capturing the final iteration value rather than each one separately. By
using the .Ptr() method instead, we force a copy of the range which we
then take a pointer to.
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/hclspecsuite/runner.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/hclspecsuite/runner.go b/cmd/hclspecsuite/runner.go index 4810454..b5a309c 100644 --- a/cmd/hclspecsuite/runner.go +++ b/cmd/hclspecsuite/runner.go @@ -283,7 +283,7 @@ func (r *Runner) runTestInput(specFilename, inputFilename string, tf *TestFile) "No %s diagnostic was expected %s. The unexpected diagnostic was shown above.", severityString(gotEntry.Severity), rangeString(gotEntry.Range), ), - Subject: &gotEntry.Range, + Subject: gotEntry.Range.Ptr(), }) } } @@ -297,7 +297,7 @@ func (r *Runner) runTestInput(specFilename, inputFilename string, tf *TestFile) "No %s diagnostic was generated %s.", severityString(wantEntry.Severity), rangeString(wantEntry.Range), ), - Subject: &declRange, + Subject: declRange.Ptr(), }) } } |
