Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
func Version ¶
func Version() string
Version returns a version string. If the version variable in this package was set to a non-empty string by the linker, Version returns that. Otherwise, if build information is available via debug.ReadBuildInfo, Version returns debug.Buildinfo.Main.Version. Otherwise, Version returns "unknown".
Types ¶
type Flags ¶
type Flags struct {
// contains filtered or unexported fields
}
func (*Flags) Init ¶
func (f *Flags) Init(all ...Initializer) (context.Context, context.CancelFunc, error)
Init is equivalent to InitWithSignals with SIGINT, SIGPIPE, and SIGTERM.
func (*Flags) InitWithSignals ¶ added in v1.8.0
func (f *Flags) InitWithSignals(all []Initializer, signals ...os.Signal) (context.Context, context.CancelFunc, error)
InitWithSignals handles the flags defined in SetFlags, calls the Init method for each element of all, and returns a context canceled when any signal in signals is raised.
type Initializer ¶
type Initializer interface {
Init() error
}
Click to show internal directories.
Click to hide internal directories.