From 5b307a07dcf6f4b8a5d2a52cfd4ae41e0e346248 Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Wed, 6 May 2020 13:34:17 -0400 Subject: [PATCH] vendor: go get github.com/hashicorp/hcl/v2@v2.5.0 --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md | 6 ++++++ .../hashicorp/hcl/v2/hclwrite/generate.go | 16 ++++++++++------ vendor/modules.txt | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index b56d1a1cb..0884e719a 100644 --- a/go.mod +++ b/go.mod @@ -68,7 +68,7 @@ require ( github.com/hashicorp/go-uuid v1.0.1 github.com/hashicorp/go-version v1.2.0 github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f - github.com/hashicorp/hcl/v2 v2.4.0 + github.com/hashicorp/hcl/v2 v2.5.0 github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 github.com/hashicorp/memberlist v0.1.0 // indirect github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb // indirect diff --git a/go.sum b/go.sum index 68ad0dc44..5ff411f07 100644 --- a/go.sum +++ b/go.sum @@ -246,8 +246,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= -github.com/hashicorp/hcl/v2 v2.4.0 h1:xwVa1aj4nCSoAjUnFPBAIfqlzPgSZEVMdkJv/mgj4jY= -github.com/hashicorp/hcl/v2 v2.4.0/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= +github.com/hashicorp/hcl/v2 v2.5.0 h1:tnNRfUho4o/6qLTqd54gj9Gs5AWmdc0tG8YdElu6MEw= +github.com/hashicorp/hcl/v2 v2.5.0/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/memberlist v0.1.0 h1:qSsCiC0WYD39lbSitKNt40e30uorm2Ss/d4JGU1hzH8= diff --git a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md index f7e094c3b..86cb0254d 100644 --- a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md +++ b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md @@ -1,5 +1,11 @@ # HCL Changelog +## v2.5.0 (May 6, 2020) + +### Enhancements + +* hclwrite: Generate multi-line objects and maps. ([#372](https://github.com/hashicorp/hcl/pull/372)) + ## v2.4.0 (Apr 13, 2020) ### Enhancements diff --git a/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go index 4d439acd7..48e131211 100644 --- a/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go @@ -119,15 +119,15 @@ func appendTokensForValue(val cty.Value, toks Tokens) Tokens { Type: hclsyntax.TokenOBrace, Bytes: []byte{'{'}, }) + if val.LengthInt() > 0 { + toks = append(toks, &Token{ + Type: hclsyntax.TokenNewline, + Bytes: []byte{'\n'}, + }) + } i := 0 for it := val.ElementIterator(); it.Next(); { - if i > 0 { - toks = append(toks, &Token{ - Type: hclsyntax.TokenComma, - Bytes: []byte{','}, - }) - } eKey, eVal := it.Element() if hclsyntax.ValidIdentifier(eKey.AsString()) { toks = append(toks, &Token{ @@ -142,6 +142,10 @@ func appendTokensForValue(val cty.Value, toks Tokens) Tokens { Bytes: []byte{'='}, }) toks = appendTokensForValue(eVal, toks) + toks = append(toks, &Token{ + Type: hclsyntax.TokenNewline, + Bytes: []byte{'\n'}, + }) i++ } diff --git a/vendor/modules.txt b/vendor/modules.txt index 32d2fd7f0..1e6d6da77 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -370,7 +370,7 @@ github.com/hashicorp/hcl/hcl/token github.com/hashicorp/hcl/json/parser github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/token -# github.com/hashicorp/hcl/v2 v2.4.0 +# github.com/hashicorp/hcl/v2 v2.5.0 ## explicit github.com/hashicorp/hcl/v2 github.com/hashicorp/hcl/v2/ext/customdecode