Documentation ¶
Index ¶
- Variables
- func B2S(b []byte) string
- func S2B(s string) []byte
- func ToBool(i interface{}) (bool, error)
- func ToDuration(i interface{}) (d time.Duration, err error)
- func ToFloat32(i interface{}) (float32, error)
- func ToFloat64(i interface{}) (float64, error)
- func ToFloat64Slice(i interface{}) ([]float64, error)
- func ToInt(i interface{}) (int, error)
- func ToInt16(i interface{}) (int16, error)
- func ToInt32(i interface{}) (int32, error)
- func ToInt64(i interface{}) (int64, error)
- func ToInt8(i interface{}) (int8, error)
- func ToIntSlice(i interface{}) ([]int, error)
- func ToString(i interface{}) (string, error)
- func ToStringMap(i interface{}) (map[string]interface{}, error)
- func ToStringMapString(i interface{}) (map[string]string, error)
- func ToStringSlice(i interface{}) ([]string, error)
- func ToUint(i interface{}) (uint, error)
- func ToUint16(i interface{}) (uint16, error)
- func ToUint32(i interface{}) (uint32, error)
- func ToUint64(i interface{}) (uint64, error)
- func ToUint8(i interface{}) (uint8, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNegativeNotAllowed = errors.New("unable to cast negative value")
Functions ¶
func B2S ¶
b2s converts byte slice to a string without memory allocation. See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ .
func ToDuration ¶
ToDuration casts an interface to a time.Duration type.
func ToFloat64Slice ¶
ToFloat64Slice casts an interface to a []float64 type.
func ToIntSlice ¶
ToIntSlice casts an interface to a []int type.
func ToStringMap ¶
ToStringMap casts an interface to a map[string]interface{} type.
func ToStringMapString ¶
ToStringMapString casts an interface to a map[string]string type.
func ToStringSlice ¶
ToStringSlice casts an interface to a []string type.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.