Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SliceFlags ¶
type SliceFlags []string
func (*SliceFlags) Set ¶
func (f *SliceFlags) Set(value string) error
Set is an implementation of the flag.Value interface
Example ¶
package main import ( "flag" "fmt" flag2 "github.com/CarsonSlovoka/slides/internal/flag" ) func main() { var flagSlice flag2.SliceFlags flag.Var(&flagSlice, "list", "-list 'b' -list 'b'") if err := flag.CommandLine.Parse([]string{ "-list", "a", "-list", "b", }); err != nil { return } fmt.Println(flagSlice) }
Output: [a b]
func (*SliceFlags) String ¶
func (f *SliceFlags) String() string
String is an implementation of the flag.Value interface
Example ¶
package main import ( "fmt" flag2 "github.com/CarsonSlovoka/slides/internal/flag" ) func main() { flagSlice := flag2.SliceFlags{"a", "b"} fmt.Println(flagSlice.String()) }
Output: [a b]
Click to show internal directories.
Click to hide internal directories.