Documentation ¶
Index ¶
- func Complex128(s string) (complex128, error)
- func Complex64(s string) (complex64, error)
- func Map(s string, mapType reflect.Type) (reflect.Value, error)
- func SignedIntegralSlice[I int | int64 | int32 | int16 | int8](s string) ([]I, error)
- func String(str string, t reflect.Type) (reflect.Value, error)
- func StringSet(s string) (map[string]struct{}, error)
- func StringSlice(s string) ([]string, error)
- func StringStringSliceMap(s string) (map[string][]string, error)
- func UnsignedIntegralSlice[I uint | uint64 | uint32 | uint16 | uint8 | uintptr](s string) ([]I, error)
- type NumberError
- type OverflowError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Complex128 ¶
func Complex128(s string) (complex128, error)
Complex128 delegates to strconv.ParseComplex for go >= 1.15.
func Map ¶
Map converts a string representation of a map with concrete values as keys and vals into a reflect.Value representing that map.
func SignedIntegralSlice ¶ added in v0.13.0
SignedIntegralSlice splits on commas and parses into a slice of integers Parses with strconv.ParseInt and the base set to 0 so base prefixes are available. Whitespace is trimmed around the integers before parsing to allow for reasonable separtion (shell word-splitting aside)
func String ¶
String casts the provided string into the provided type, returning the result in a reflect.Value.
func StringSet ¶
StringSet splits a comma separated string and constructs a map[string]struct{} to represent a set
func StringSlice ¶
StringSlice splits a comma separated string and constructs a slice
func StringStringSliceMap ¶
StringStringSliceMap takes in a string representation of a map with strings as keys and string slices as values, and converts it to a map[string][]string.
func UnsignedIntegralSlice ¶ added in v0.13.0
func UnsignedIntegralSlice[I uint | uint64 | uint32 | uint16 | uint8 | uintptr](s string) ([]I, error)
UnsignedIntegralSlice splits on commas and parses into a slice of integers Parses with strconv.ParseInt and the base set to 0 so base prefixes are available. Whitespace is trimmed around the integers before parsing to allow for reasonable separtion (shell word-splitting aside)
Types ¶
type NumberError ¶
type NumberError struct {
// contains filtered or unexported fields
}
NumberError represents an error when parsing a string to generate a numeric type.
func (*NumberError) Error ¶
func (e *NumberError) Error() string
func (*NumberError) Unwrap ¶
func (e *NumberError) Unwrap() error
type OverflowError ¶
type OverflowError struct {
// contains filtered or unexported fields
}
OverflowError represents an overflow when casting to a numeric type.
func (*OverflowError) Error ¶
func (e *OverflowError) Error() string
func (*OverflowError) Unwrap ¶
func (e *OverflowError) Unwrap() error