Documentation ¶
Index ¶
- Constants
- Variables
- func FromBool(from bool, to any) error
- func FromFloat32(from float32, to any) error
- func FromFloat64(from float64, to any) error
- func FromInt(from int, to any) error
- func FromInt16(from int16, to any) error
- func FromInt32(from int32, to any) error
- func FromInt64(from int64, to any) error
- func FromInt8(from int8, to any) error
- func FromString(from string, to any) error
- func FromUint(from uint, to any) error
- func FromUint16(from uint16, to any) error
- func FromUint32(from uint32, to any) error
- func FromUint64(from uint64, to any) error
- func FromUint8(from uint8, to any) error
- func ToBool(from any, to *bool) error
- func ToFloat32(from any, to *float32) error
- func ToFloat64(from any, to *float64) error
- func ToInt(from any, to *int) error
- func ToInt16(from any, to *int16) error
- func ToInt32(from any, to *int32) error
- func ToInt64(from any, to *int64) error
- func ToInt8(from any, to *int8) error
- func ToString(from any, to *string) error
- func ToTime(from any, to *time.Time, layouts ...string) error
- func ToUint(from any, to *uint) error
- func ToUint16(from any, to *uint16) error
- func ToUint32(from any, to *uint32) error
- func ToUint64(from any, to *uint64) error
- func ToUint8(from any, to *uint8) error
Constants ¶
View Source
const ( ISO8601DateLayout = "2006-01-02" ISO8601TimeLayout = "15:04:05" ISO860TimestampLayout = "2006-01-02T15:04:05" DateTime = "2006-01-02 15:04:05" DateTimeZ = "2006-01-02 15:04:05 MST" DateTimeNZ = "2006-01-02 15:04:05 -0700" )
Variables ¶
View Source
var ErrCast = errors.New("cast error")
View Source
var SupportedTimeLayouts = []string{ DateTime, DateTimeZ, DateTimeNZ, ISO860TimestampLayout, time.RFC3339, time.RFC3339Nano, time.RFC1123, time.RFC1123Z, }
SupportedTimeLayouts is a list of supported time layouts.
Functions ¶
func FromFloat32 ¶ added in v1.1.0
FromFloat32 casts an interface to an float32 type.
func FromFloat64 ¶ added in v1.1.0
FromFloat64 casts an interface to an float64 type.
func FromString ¶ added in v1.1.0
FromString casts an interface to a string type.
func FromUint16 ¶
FromUint16 casts an interface to an uint16 type.
func FromUint32 ¶
FromUint32 casts an interface to an uint32 type.
func FromUint64 ¶
FromUint64 casts an interface to an uint64 type.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.