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

Misleading documentation for func StringToStringVar #397

Open
fxierh opened this issue Mar 18, 2024 · 1 comment
Open

Misleading documentation for func StringToStringVar #397

fxierh opened this issue Mar 18, 2024 · 1 comment

Comments

@fxierh
Copy link

fxierh commented Mar 18, 2024

Quoting from the documentation of func StringToStringVar:

The value of each argument will not try to be separated by comma.

However with the following program:

res := make(map[string]string)
flag.StringToStringVar(&res, "foo-flag", res, "foo-flag-usage")
flag.Parse()

go run ... --foo-flag "foo=bar,baz=quux" results in res = map[baz:quux foo:bar].

@fxierh fxierh changed the title Inaccurate documentation for func StringToStringVar Misleading documentation for func StringToStringVar Mar 18, 2024
@fxierh
Copy link
Author

fxierh commented Mar 18, 2024

I'm happy to submit a PR for this if needed.

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

No branches or pull requests

1 participant