Documentation
¶
Overview ¶
Package hclcomment writes comments into an hclwrite body.
It sits here rather than beside its first caller because both the providers and the step package write comments, and the step package is imported by the providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Line ¶
Line returns line as an HCL comment, adding a "#" only if the line does not already carry one. Everything else about the text is left alone.
func Trailing ¶
Trailing returns tokens with comment appended, so it lands on the same line as the value those tokens write. An empty comment returns tokens unchanged.
No newline in the comment bytes: the attribute brings its own, and a second one leaves a blank line after every commented attribute.
func WriteLeading ¶
WriteLeading emits comment as HCL comment lines above whatever is appended next. An empty comment writes nothing.
The text is written as it was read. A comment is prose, and its spacing, its "#" count and its indentation are things its author chose, so rewriting them changes what was written for no gain. The one thing added is a missing "#": a line reaching HCL without one is not a comment but a syntax error in the generated file.
Types ¶
This section is empty.