Skip to content

Misleading documentation for func StringToStringVar #397

Open
@fxierh

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions