diff options
Diffstat (limited to 'vendor/github.com/hashicorp/hcl/decoder.go')
-rw-r--r-- | vendor/github.com/hashicorp/hcl/decoder.go | 7 |
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 |