Documentation ¶
Index ¶
- func Describe() string
- func StructToMap(obj interface{}) map[string]interface{}
- func ToFloat32(i interface{}) (float32, error)
- func ToFloat64(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 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)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StructToMap ¶
func StructToMap(obj interface{}) map[string]interface{}
func ToInt ¶
ToIntE casts an interface to an int type.
Example ¶
res1, err := ToInt(1.1) if err != nil { fmt.Println(err) return } fmt.Println(res1) res2, err := ToInt("2.2") if err != nil { fmt.Println(err) return } fmt.Println(res2)
Output: 1 2
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.