From 05ea81cb031e5043d1b19bfd6c5b416145f07f89 Mon Sep 17 00:00:00 2001 From: Tomer Heber Date: Mon, 6 Jun 2022 11:20:25 -0500 Subject: [PATCH] format.go nilToken not 'thread' safe --- hclwrite/format.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hclwrite/format.go b/hclwrite/format.go index 2b4ba323..dc7bc73e 100644 --- a/hclwrite/format.go +++ b/hclwrite/format.go @@ -119,7 +119,7 @@ func formatSpaces(lines []formatLine) { if i < (len(line.lead) - 1) { after = line.lead[i+1] } else { - after = nilToken + continue } if spaceAfterToken(token, before, after) { after.SpacesBefore = 1 @@ -143,7 +143,7 @@ func formatSpaces(lines []formatLine) { if i < (len(line.assign) - 1) { after = line.assign[i+1] } else { - after = nilToken + continue } if spaceAfterToken(token, before, after) { after.SpacesBefore = 1