I've defined a custom flag for accepting a slice of strings as such:
type strSliceFlag []string
func (i *strSliceFlag) String() string {
return fmt.Sprint(*i)
}
func (i *strSliceFlag) Set(value string) error {
*i = append(*i, value)
return nil
}
I then parse it with
...
var tags strSliceFlag
flag.Var(&tags, "t", tFlagExpl)
flag.Parse()
...
When I build this program, and run it with the help flag: main -h, it prints out:
Usage of main:
-t value
Test explanation
My question is, where is the word value coming from? I can't find out how to remove it. I think it maybe has something to do with the default value for the flag.