I have two struct having the same members, I want to copy one struct to another, see the pseudo code below:
struct
type Common struct { Gender int From string To string } type Foo struct { Id string Name string Extra Common } type Bar struct { Id string Name string Extra Common }
Then I have foo of struct Foo, and bar of struct Bar, Is there any way to copy bar from foo?
foo
Foo
bar
Bar
1.4m articles
1.4m replys
5 comments
57.0k users