Skip to content

fix: ignore empty StringArray values; clarify SortFlags docs#470

Open
leno23 wants to merge 1 commit into
spf13:masterfrom
leno23:fix/string-array-empty-and-sortflags-docs
Open

fix: ignore empty StringArray values; clarify SortFlags docs#470
leno23 wants to merge 1 commit into
spf13:masterfrom
leno23:fix/string-array-empty-and-sortflags-docs

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

Fixes #415 and #456.

  • Empty --flag="" no longer appends a single empty string to StringArray flags
  • README shows SortFlags on a FlagSet instance

Test plan

  • go test ./...

Made with Cursor

Fixes spf13#415 and spf13#456.

Skip empty string values when parsing StringArray flags so `--flag=""`
does not produce a single empty entry. Update README to show SortFlags on
a FlagSet instead of the package level.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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