aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/hashicorp/hcl/decoder.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-07-17 17:16:14 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-07-17 18:24:20 +0100
commitc9849d667ab55c23d343332a11afb3eb8ede3f2d (patch)
tree86684d5481d8b12be84ea1a3a8f32afaac007efa /vendor/github.com/hashicorp/hcl/decoder.go
parent49f40a952943f26494d6407dc608b50b2ec0df7f (diff)
Update vendor libs
Diffstat (limited to 'vendor/github.com/hashicorp/hcl/decoder.go')
-rw-r--r--vendor/github.com/hashicorp/hcl/decoder.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/hashicorp/hcl/decoder.go b/vendor/github.com/hashicorp/hcl/decoder.go
index 02888d2..cfddbf3 100644
--- a/vendor/github.com/hashicorp/hcl/decoder.go
+++ b/vendor/github.com/hashicorp/hcl/decoder.go
@@ -517,6 +517,12 @@ func (d *decoder) decodeStruct(name string, node ast.Node, result reflect.Value)
structType := structVal.Type()
for i := 0; i < structType.NumField(); i++ {
fieldType := structType.Field(i)
+ tagParts := strings.Split(fieldType.Tag.Get(tagName), ",")
+
+ // Ignore fields with tag name "-"
+ if tagParts[0] == "-" {
+ continue
+ }
if fieldType.Anonymous {
fieldKind := fieldType.Type.Kind()
@@ -531,7 +537,6 @@ func (d *decoder) decodeStruct(name string, node ast.Node, result reflect.Value)
// We have an embedded field. We "squash" the fields down
// if specified in the tag.
squash := false
- tagParts := strings.Split(fieldType.Tag.Get(tagName), ",")
for _, tag := range tagParts[1:] {
if tag == "squash" {
squash = true