Created
June 21, 2015 04:08
-
-
Save tcnksm/f40b8f2420cac05240c7 to your computer and use it in GitHub Desktop.
Flag slice
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
import "strings" | |
type StringFlag []string | |
func (s *StringFlag) String() string { | |
return strings.Join(*s, ",") | |
} | |
func (s *StringFlag) Set(value string) error { | |
*s = append(*s, value) | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment