MapHelper

package
v1.1.162 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToUrlString

func MapToUrlString(dataMap map[string]interface{}) string

func Struct2Map

func Struct2Map(param interface{}, parseType string) map[string]interface{}

func Struct2MapNoNil

func Struct2MapNoNil(param interface{}, parseType string) (map[string]interface{}, error)

* 结构体转map @param param 结构体 指针或非针 @param parseType 指定结构字属性 tag 字段 自定义

[example] --------

type Maps struct {
  Data string `map:"data"`
  NumberName int `map:"number_name"`
}
mp:=Maps{
  Data:       "111",
  NumberName: 2,
}

a,_:=MapHelper.Struct2Map(mp, "map") fmt.Printf("%+v",a) --------

Types

This section is empty.

Jump to

Keyboard shortcuts

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