Skip to content

private fields #13

@anpic

Description

@anpic

@elgopher

Is your feature request related to a problem? Please describe.
please add support private fields too

type A struct {
	A string
	a string
}

m mapify.Mapper
if v, err := m.MapAny(A{ A: "A", a: "a" }); err == nil {
	fmt.Println(v)    // map[A:A]
}

Describe the solution you'd like

m mapify.Mapper
m.PrivateFields = true
m.PublicFields = true
// m.Fields = true // for both
if v, err := m.MapAny(A{ A: "A", a: "a" }); err == nil {
	fmt.Println(v)    // map[A:A,a:a]
}
m mapify.Mapper
m.PrivateFields = true
m.PublicFields = false
if v, err := m.MapAny(A{ A: "A", a: "a" }); err == nil {
	fmt.Println(v)    // map[a:a]
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions