Skip to content

fix: treat lone empty StringArray flag as empty slice#472

Open
leno23 wants to merge 1 commit into
spf13:masterfrom
leno23:fix/string-array-empty-flag-value-415
Open

fix: treat lone empty StringArray flag as empty slice#472
leno23 wants to merge 1 commit into
spf13:masterfrom
leno23:fix/string-array-empty-flag-value-415

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Fixes #415

Made with Cursor

@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.

Passing --flag="" no longer produces a one-element slice containing
an empty string when the default value is empty.

Fixes spf13#415

Co-authored-by: Cursor <cursoragent@cursor.com>
@leno23 leno23 force-pushed the fix/string-array-empty-flag-value-415 branch from 8f4e1ed to 34a45f1 Compare May 17, 2026 11:13
@tomasaschan
Copy link
Copy Markdown
Collaborator

This is a breaking change for any user who tries to create an array with the empty string as an element.

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

3 participants