Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty slice not allocated #155

Merged
merged 1 commit into from
Mar 18, 2020
Merged

Conversation

zhsj
Copy link
Contributor

@zhsj zhsj commented Feb 3, 2019

Add a testcase, which will fail without patch.

Closes: #146

@zhsj
Copy link
Contributor Author

zhsj commented Feb 7, 2019

@mitchellh do you have time for a look? I really need to know the expected behavior(whether the original issue is valid or not) and I need to fix other softwares which use mapstructure.

@alexpjohnson
Copy link

Is there an update on this?

@mitchellh
Copy link
Owner

Thank you!

@mitchellh mitchellh merged commit d476ae3 into mitchellh:master Mar 18, 2020
@zhsj zhsj deleted the fix-empty-slice branch March 19, 2020 01:21
sagikazarmark added a commit to spf13/viper that referenced this pull request Sep 30, 2020
Mapstructure so far returned nil for empty string slices.
In a recent version this bug has been fixed:
mitchellh/mapstructure#155

Incidentally, this was a bug in Viper too:

GetStringSlice and Unmarshal returned with different values.

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
sagikazarmark added a commit to spf13/viper that referenced this pull request Sep 30, 2020
Mapstructure so far returned nil for empty string slices.
In a recent version this bug has been fixed:
mitchellh/mapstructure#155

Incidentally, this was a bug in Viper too:

GetStringSlice and Unmarshal returned with different values.

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
sagikazarmark added a commit to spf13/viper that referenced this pull request Sep 30, 2020
Mapstructure so far returned nil for empty string slices.
In a recent version this bug has been fixed:
mitchellh/mapstructure#155

Incidentally, this was a bug in Viper too:

GetStringSlice and Unmarshal returned with different values.

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
brainexe pushed a commit to brainexe/viper that referenced this pull request Nov 12, 2020
Mapstructure so far returned nil for empty string slices.
In a recent version this bug has been fixed:
mitchellh/mapstructure#155

Incidentally, this was a bug in Viper too:

GetStringSlice and Unmarshal returned with different values.

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@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.

Issue with not allocating empty slice in struct
3 participants