Skip to content

Instantly share code, notes, and snippets.

@apokalyptik
Created August 10, 2014 15:51
Show Gist options
  • Save apokalyptik/906360ae7c917892c21d to your computer and use it in GitHub Desktop.
Save apokalyptik/906360ae7c917892c21d to your computer and use it in GitHub Desktop.
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