there are two structs with the same filed
type AA struct {
Name string
Addr string
}
type BB struct {
Name string
Addr string
}
init A with B data we should init like follow:
aa := A{Name: b.Name, Addr: b.Addr}
sometimes the struct has more fields, this init logic will be too large and cannot be readable.
there are two structs with the same filed
init A with B data we should init like follow:
sometimes the struct has more fields, this init logic will be too large and cannot be readable.