mapUtil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(source, target map[string]interface{}) map[string]interface{}

func FromJsonStr

func FromJsonStr(str string) interface{}

func MapToStruct

func MapToStruct(m map[string]interface{}, t interface{})

* go get github.com/goinggo/mapstructure

func MapToStructDemo(){
        mapInstance := make(map[string]interface{})
        mapInstance["Name"] = "jqw"
        mapInstance["Age"] = 18

        var people People
        err := mapstructure.Decode(mapInstance, &people)
        if err != nil {
                fmt.Println(err)
        }
        fmt.Println(people)
}

func ObjByAnchorFromMap

func ObjByAnchorFromMap(obj interface{}, anchor []string) interface{}

func StructToMap

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

func ToJsonStr

func ToJsonStr(obj interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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