Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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")
log.Printf("%#v", foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment