Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tcnksm
Created June 21, 2015 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcnksm/f40b8f2420cac05240c7 to your computer and use it in GitHub Desktop.
Save tcnksm/f40b8f2420cac05240c7 to your computer and use it in GitHub Desktop.
Flag slice
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