Created
August 10, 2014 15:51
-
-
Save apokalyptik/906360ae7c917892c21d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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