Create a gist now

Instantly share code, notes, and snippets.

type Foo struct {
value []string
}
func (f *Foo) String() string {
return ""
}
func (f *Foo) Set(s string) error {
f.value = append(f.value, s)
return nil
}
var foo = Foo{}
func main() {
flag.Var(&foo, "foo", "foo")
flag.Parse()
log.Printf("%#v", foo)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment