Skip to content

Instantly share code, notes, and snippets.

@apokalyptik
Created August 10, 2014 15:51
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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