8000 GitHub - ganjinlin/go-structmap: Struct conversion to map
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ganjinlin/go-structmap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Struct map

This module is used to convert struct into map recursively

Example

import stm "github.com/alileza/go-structmap"

type MyStruct struct{}

func main(){
    myStruct := &MyStruct{}
    fmt.Println(stm.StructToMap(*myStruct))

    // if you put true on the second parameter
    // it will convert all of your datatype into string
    // unless (bool, nil)
    fmt.Println(stm.StructToMap(*myStruct, true))
}

About

Struct conversion to map

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%
0