vendor: go get github.com/hashicorp/hcl/v2@v2.5.0

This commit is contained in:
Alisdair McDiarmid 2020-05-06 13:34:17 -04:00
parent e186264439
commit 5b307a07dc
5 changed files with 20 additions and 10 deletions

2
go.mod
View File

@ -68,7 +68,7 @@ require (
github.com/hashicorp/go-uuid v1.0.1 github.com/hashicorp/go-uuid v1.0.1
github.com/hashicorp/go-version v1.2.0 github.com/hashicorp/go-version v1.2.0
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f 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/hil v0.0.0-20190212112733-ab17b08d6590
github.com/hashicorp/memberlist v0.1.0 // indirect github.com/hashicorp/memberlist v0.1.0 // indirect
github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb // indirect github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb // indirect

4
go.sum
View File

@ -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 h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws=
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= 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.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90=
github.com/hashicorp/hcl/v2 v2.4.0 h1:xwVa1aj4nCSoAjUnFPBAIfqlzPgSZEVMdkJv/mgj4jY= github.com/hashicorp/hcl/v2 v2.5.0 h1:tnNRfUho4o/6qLTqd54gj9Gs5AWmdc0tG8YdElu6MEw=
github.com/hashicorp/hcl/v2 v2.4.0/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= 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 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI=
github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE=
github.com/hashicorp/memberlist v0.1.0 h1:qSsCiC0WYD39lbSitKNt40e30uorm2Ss/d4JGU1hzH8= github.com/hashicorp/memberlist v0.1.0 h1:qSsCiC0WYD39lbSitKNt40e30uorm2Ss/d4JGU1hzH8=

View File

@ -1,5 +1,11 @@
# HCL Changelog # 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) ## v2.4.0 (Apr 13, 2020)
### Enhancements ### Enhancements

View File

@ -119,15 +119,15 @@ func appendTokensForValue(val cty.Value, toks Tokens) Tokens {
Type: hclsyntax.TokenOBrace, Type: hclsyntax.TokenOBrace,
Bytes: []byte{'{'}, Bytes: []byte{'{'},
}) })
if val.LengthInt() > 0 {
toks = append(toks, &Token{
Type: hclsyntax.TokenNewline,
Bytes: []byte{'\n'},
})
}
i := 0 i := 0
for it := val.ElementIterator(); it.Next(); { for it := val.ElementIterator(); it.Next(); {
if i > 0 {
toks = append(toks, &Token{
Type: hclsyntax.TokenComma,
Bytes: []byte{','},
})
}
eKey, eVal := it.Element() eKey, eVal := it.Element()
if hclsyntax.ValidIdentifier(eKey.AsString()) { if hclsyntax.ValidIdentifier(eKey.AsString()) {
toks = append(toks, &Token{ toks = append(toks, &Token{
@ -142,6 +142,10 @@ func appendTokensForValue(val cty.Value, toks Tokens) Tokens {
Bytes: []byte{'='}, Bytes: []byte{'='},
}) })
toks = appendTokensForValue(eVal, toks) toks = appendTokensForValue(eVal, toks)
toks = append(toks, &Token{
Type: hclsyntax.TokenNewline,
Bytes: []byte{'\n'},
})
i++ i++
} }

2
vendor/modules.txt vendored
View File

@ -370,7 +370,7 @@ github.com/hashicorp/hcl/hcl/token
github.com/hashicorp/hcl/json/parser github.com/hashicorp/hcl/json/parser
github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/scanner
github.com/hashicorp/hcl/json/token github.com/hashicorp/hcl/json/token
# github.com/hashicorp/hcl/v2 v2.4.0 # github.com/hashicorp/hcl/v2 v2.5.0
## explicit ## explicit
github.com/hashicorp/hcl/v2 github.com/hashicorp/hcl/v2
github.com/hashicorp/hcl/v2/ext/customdecode github.com/hashicorp/hcl/v2/ext/customdecode