We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Code Example:
package main import ( "fmt" "github.com/spf13/pflag" ) func main() { fs := pflag.NewFlagSet("test", pflag.PanicOnError) fs.StringToString("testflag", map[string]string{}, "") fs.Set("testflag", "x=[]") fmt.Println(fs.Lookup("testflag").Value.String()) result, _ := fs.GetStringToString("testflag") fmt.Println(result) }
With pflag Version 1.0.5 the output is:
[x=[]] map[x:]
I would have expected:
[x=[]] map[x:[]]
Looking at the code, it looks like the Trim() here also removes brackets at the end of the flag value, not just those added by String(): https://github.com/spf13/pflag/blob/master/string_to_string.go#L80
The text was updated successfully, but these errors were encountered:
Fix bracket handling in StringToString (spf13#413)
aaacefa
43398d3
No branches or pull requests
Code Example:
With pflag Version 1.0.5 the output is:
I would have expected:
Looking at the code, it looks like the Trim() here also removes brackets at the end of the flag value, not just those added by String(): https://github.com/spf13/pflag/blob/master/string_to_string.go#L80
The text was updated successfully, but these errors were encountered: