map2struct

package
v0.0.0-...-517d9f4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package map2struct Time : 2022/8/14 09:22 Author : xushiyin contact : yuqingxushiyin@gmail.com

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Family

type Family struct {
	LastName string `mapstructure:"LastName"`
}

type Location

type Location struct {
	City string `mapstructure:"City"`
}

type Person

type Person struct {
	Name   string
	Age    int
	Emails []string
	Extra  map[string]string
}

func PersonMap2Struct

func PersonMap2Struct(input interface{}) (*Person, error)

func PersonMap2StructWeak

func PersonMap2StructWeak(input interface{}) (*Person, error)

func (Person) String

func (p Person) String() string

type Person2

type Person2 struct {
	Family    `mapstructure:"Family,squash"`
	Location  `mapstructure:"Location,squash"`
	FirstName string `mapstructure:"FirstName"`
}

func Person2Map2StructSquash

func Person2Map2StructSquash(input interface{}) (*Person2, error)

func (Person2) String

func (p Person2) String() string

type Person3

type Person3 struct {
	Name string
	Age  int
}

func Person3Map2StructConf

func Person3Map2StructConf(input interface{}) (*Person3, error)

func (Person3) String

func (p Person3) String() string

Jump to

Keyboard shortcuts

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