Skip to content

decode: skip mapstructure:"-" fields so ErrorUnset doesn't flag them#191

Open
c-tonneslan wants to merge 1 commit into
go-viper:mainfrom
c-tonneslan:fix/error-unset-honors-dash-tag
Open

decode: skip mapstructure:"-" fields so ErrorUnset doesn't flag them#191
c-tonneslan wants to merge 1 commit into
go-viper:mainfrom
c-tonneslan:fix/error-unset-honors-dash-tag

Conversation

@c-tonneslan
Copy link
Copy Markdown

Closes #89.

mapstructure:"-" means a field is opted out of decoding, but the decoder still walked it during struct iteration and added the literal "-" key to Metadata.Unset, which made ErrorUnset trip on it. Honour the tag by continuing past the field, matching how the encoder already handles it.

Closes mitchellh#89.

mapstructure:"-" means a field is opted out of decoding, but the
decoder still walked it during struct iteration and added the literal
"-" key to Metadata.Unset, which made ErrorUnset trip on it. Honour
the tag by continuing past the field, matching how the encoder
already handles it.

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ErrorUnset conflicts with UntaggedFields

1 participant