mapper icon indicating copy to clipboard operation
mapper copied to clipboard

proposal: support mapping between pointer and value

Open shyandsy opened this issue 3 years ago • 0 comments

I plan to make a new feature to support mapping between pointer and value

example:

type A struct{
    Age int `mapper:"age"`
}

type B struct{
    Age *int `mapper:"age"`
} 

func main(){
    a := A{Age:1}
    b := B{}
    m := mapper.NewMapper()

    m.Mapper(&a, &b)

    // now b.Age = 1
}

shyandsy avatar Apr 17 '22 17:04 shyandsy