Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanParseType ¶
CanParseType returns true if the specified type has a registered value parser, implements to flag.Value interface or implements encoding.TextUnmarshaler interface.
func Parse ¶
Parse converts a string into an actual value, using a string conversion function specific to the target type. `v` must be a non-nil pointer to a variable to parse into, and panics otherwise. Types with a registered parser function, including all common primitive types are converted using that parser function. Types that conform to the flag.Value interface are converted with the Set() method. Types that conform to the encoding.TextUnmarshaler interface are converted using the UnmarshalText() method. The function panics if the target ype is not parsable.
func RegisterParser ¶
func RegisterParser(parsers ...interface{})
RegisterParser registers a function of type 'func(string) (T, error)' as value parser for type T
Types ¶
This section is empty.