mapstruct

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToStruct

func MapToStruct(m map[string]interface{}, data interface{}) (err error)

MapToStruct *

  • @Description: Map转Struct
  • @param m
  • @param data
  • @return err

func MapToStruct0

func MapToStruct0(m map[string]interface{}, data interface{}) (err error)

MapToStruct0 *

  • @Description: Map转Struct
  • @param m
  • @param data
  • @return err

func StructToMap

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

StructToMap *

  • @Description: Struct转Map
  • @param obj
  • @return map[string]interface{}

Types

type User

type User struct {
	Name        string   `json:"name"`
	PhoneNumber string   `json:"phone_number"`
	UserName    string   `json:"userName"`
	Hobbies     []string `json:"hobbies"`
}

Jump to

Keyboard shortcuts

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