This repository was archived by the owner on May 26, 2023. It is now read-only.

Description
For some flags I create my own type so I can apply the flag multiple times and store it in a slice. It looks something like this.
./myapp -multi 1 -multi 2 -multi 3
type arrayFlags []string
func (i *arrayFlags) String() string {
return "[]"
}
func (i *arrayFlags) Set(value string) error {
*i = append(*i, value)
return nil
}
var multi arrayFlags
flag.Var(&multi , "multi", "Apply this multiple times")
This works great but when I try to use a config I always only get the first value.
./myapp -config my.conf
The value of multi is always just [1].
Is there a way I can get this to work when using a configuration file?