Documentation
¶
Overview ¶
Package conv provides fast type conversions. Overflow and non-finite (NaN/Inf) inputs error; a float-to-integer conversion truncates toward zero.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTimeLayouts = []string{ time.RFC3339Nano, time.RFC3339, "2006-01-02 15:04:05", "2006-01-02T15:04:05", "2006-01-02", "2006/01/02", "15:04:05", }
DefaultTimeLayouts are tried in order by ToTime when no layout is given.
View Source
var ErrConvert = errors.New("conv: cannot convert value")
ErrConvert is the base error for a failed conversion.
Functions ¶
func ParseBool ¶
ParseBool parses the usual truthy/falsy tokens (case-insensitive, trimmed); unknown input errors.
func ToBool ¶
ToBool converts v to a bool; truthy/falsy strings are accepted, numbers are true when non-zero.
func ToString ¶
ToString converts v to its string representation; pointers are dereferenced (nil yields "").
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.