I'm glad I could help.
Cheers,
-- Jacques
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on t
i read your code, and try to write my code,
package main
import (
"fmt"
"reflect"
)
type A struct{ Name string }
type B struct{ Age int }
type C struct{ Address string }
func Merge(a interface{}, b interface{})( d interface{}) {
aType := reflect.TypeOf(a)
if aType.Kind() != reflect.Struct {
pan
As suggested by Kurtis Rader, I would use "reflection" for this.
Here is a simple example (not fully tested, probably not safe, not
production ready... so just for demonstration purpose) :
https://play.golang.org/p/sAyBajxsTAN
-- Jacques
--
You received this message because you are subscribed