flaghelpers

package
v1.2.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringFlag

type StringFlag struct {
	// contains filtered or unexported fields
}

StringFlag is a custom struct implementing flag.Value interface It is needed to detect whether a flag has actually been set or not since a string's nil value is "" and that could be a valid value

func NewStringFlag

func NewStringFlag() StringFlag

NewStringFlag returns a new StringFlag that implements flag.Var interface. This allows us to check whether the string flag was actually set or not instead of just comparing the string to empty string

func (*StringFlag) IsSet

func (s *StringFlag) IsSet() bool

IsSet indicates if whether the flag has actually been set or not

func (*StringFlag) Set

func (s *StringFlag) Set(in string) error

Set implements the flag.Value interface

func (*StringFlag) String

func (s *StringFlag) String() string

String implements the flag.Value interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL