maob_shift

package
v0.0.0-...-8268eb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

结果体转换

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Describe

func Describe() string

func StructToMap

func StructToMap(obj interface{}) map[string]interface{}

func ToFloat32

func ToFloat32(i interface{}) (float32, error)

ToFloat32E casts an interface to a float32 type.

func ToFloat64

func ToFloat64(i interface{}) (float64, error)

ToFloat64E casts an interface to a float64 type.

func ToInt

func ToInt(i interface{}) (int, error)

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

func ToInt16

func ToInt16(i interface{}) (int16, error)

ToInt16E casts an interface to an int16 type.

func ToInt32

func ToInt32(i interface{}) (int32, error)

ToInt32E casts an interface to an int32 type.

func ToInt64

func ToInt64(i interface{}) (int64, error)

ToInt64E casts an interface to an int64 type.

func ToInt8

func ToInt8(i interface{}) (int8, error)

ToInt8E casts an interface to an int8 type.

func ToUint

func ToUint(i interface{}) (uint, error)

ToUintE casts an interface to a uint type.

func ToUint16

func ToUint16(i interface{}) (uint16, error)

ToUint16E casts an interface to a uint16 type.

func ToUint32

func ToUint32(i interface{}) (uint32, error)

ToUint32E casts an interface to a uint32 type.

func ToUint64

func ToUint64(i interface{}) (uint64, error)

ToUint64E casts an interface to a uint64 type.

func ToUint8

func ToUint8(i interface{}) (uint8, error)

ToUint8E casts an interface to a uint type.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL