On Saturday, August 24, 2019 at 3:39:27 AM UTC-4, Lee Rick wrote:
>
> think that there are two struct, they have different fields, hope that
> there has a function merge(a,b interface{}) interface{}, input param are
> any two struct, they may have same-type, or have different-type. output
> para
think that there are two struct, they have different fields, hope that
there has a function merge(a,b interface{}) interface{}, input param are
any two struct, they may have same-type, or have different-type. output
param is a struct that composed the two input struct, example type A
sturct{Nam
think that there are two struct, they have different fields, hope that
there has a function merge(a,b interface{}) interface{}, input param are
any two struct, they may have same-type, or have different-type. output
param is a struct that composed the two input struct, example type A
sturct{Nam
think that there are two struct, they have different fields, hope that
there has a function merge(a,b interface{}) interface{}, input param are
any two struct, they may have same-type, or have different-type. output
param is a struct that composed the two input struct, example type A
sturct{Nam
On Sat, Aug 24, 2019 at 5:25 AM Lee Rick wrote:
>
> i want to do
> type A struct{ Name string}
> type B struct{Age int}
> type C struct{Address string}
>
> a, b, c := A{}, B{},C{}
> have a function
> d1 := merge(a,b) //d1 like struct{Name string, Age int}
> d2 := merge(a,c) //d2 like struct{Name
On Fri, Aug 23, 2019 at 10:11 PM Lee Rick wrote:
> it's not my need, hope other methods
>
Then you need to explain why that answer is not satisfactory and otherwise
better explain your requirements. In your hypothetical example the objects
such as `d1` would not be usable except via reflection (
On Fri, Aug 23, 2019 at 11:11 PM Lee Rick wrote:
>
> it's not my need, hope other methods
What is your need? What are the types of the variables d1, d2, d3 in
your example?
>
> 在 2019年8月24日星期六 UTC+8上午11:43:32,burak serdar写道:
>>
>> On Fri, Aug 23, 2019 at 9:25 PM Lee Rick wrote:
>> >
>> > i want
it's not my need, hope other methods
在 2019年8月24日星期六 UTC+8上午11:43:32,burak serdar写道:
>
> On Fri, Aug 23, 2019 at 9:25 PM Lee Rick >
> wrote:
> >
> > i want to do
> > type A struct{ Name string}
> > type B struct{Age int}
> > type C struct{Address string}
> >
> > a, b, c := A{}, B{},C{}
>
On Fri, Aug 23, 2019 at 9:25 PM Lee Rick wrote:
>
> i want to do
> type A struct{ Name string}
> type B struct{Age int}
> type C struct{Address string}
>
> a, b, c := A{}, B{},C{}
> have a function
> d1 := merge(a,b) //d1 like struct{Name string, Age int}
> d2 := merge(a,c) //d2 like struct{Name
i want to do
type A struct{ Name string}
type B struct{Age int}
type C struct{Address string}
a, b, c := A{}, B{},C{}
have a function
d1 := merge(a,b) //d1 like struct{Name string, Age int}
d2 := merge(a,c) //d2 like struct{Name string, Address string}
d3 := merge(b,c) //d3 like struct{Age int,
10 matches
Mail list logo