Skip to content

Commit

Permalink
Merge pull request hashicorp#344 from hashicorp/gohcl-document-optional
Browse files Browse the repository at this point in the history
gohcl: document optional attribute
  • Loading branch information
vancluever authored Feb 18, 2020
2 parents cec773f + 939ae58 commit 5200d8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gohcl/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// attr (the default) indicates that the value is to be populated from an attribute
// block indicates that the value is to populated from a block
// label indicates that the value is to populated from a block label
// optional is the same as attr, but the field is optional
// remain indicates that the value is to be populated from the remaining body after populating other fields
//
// "attr" fields may either be of type *hcl.Expression, in which case the raw
Expand All @@ -34,6 +35,9 @@
// the blocks being decoded. In this case, the name token is used only as
// an identifier for the label in diagnostic messages.
//
// "optional" fields behave like "attr" fields, but they are optional
// and will not give parsing errors if they are missing.
//
// "remain" can be placed on a single field that may be either of type
// hcl.Body or hcl.Attributes, in which case any remaining body content is
// placed into this field for delayed processing. If no "remain" field is
Expand Down

0 comments on commit 5200d8d

Please sign in to comment.