Golang flag.FlagSet type and flag.NewFlagSet() function example

package flag

A FlagSet represents a set of defined flags. The zero value of a FlagSet has no name and has ContinueOnError error handling.

Golang flag.FlagSet type and flag.NewFlagSet() function usage example

 f := flag.NewFlagSet("flag", flag.ExitOnError)

References :

http://golang.org/pkg/flag/#NewFlagSet

http://golang.org/pkg/flag/#FlagSet

Advertisement