Skip to content

fix: treat empty StringArray value as empty slice#499

Open
Solaris-star wants to merge 1 commit into
spf13:masterfrom
Solaris-star:fix/415-stringarray-empty
Open

fix: treat empty StringArray value as empty slice#499
Solaris-star wants to merge 1 commit into
spf13:masterfrom
Solaris-star:fix/415-stringarray-empty

Conversation

@Solaris-star

Copy link
Copy Markdown

Summary

--arr= (empty) produced []string{\"\"} instead of an empty slice (#415).

Fix

On first Set, map empty string to []string{}.

Tests

go test . -count=1 -run TestStringArrayEmptyValue
# ok

Fixes #415

Passing --arr= (empty) produced []string{""} instead of an empty slice
(spf13#415). On first Set, map empty string to []string{}.

Fixes spf13#415
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Passing empty string to StringArrayVar results in array of 1 element

2 participants