I have two struct
having the same members, I want to copy one struct to another, see the pseudo code below:
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
?