import (
"log"
"github.com/jinzhu/copier"
)
type x struct{ Name string }
type structSameName1 struct {
A string
B []x
}
type structSameName2 struct {
A string
B x
}
func main() {
obj1 := structSameName1{A: "123", B: []x{{Name: "ee"}}}
obj2 := &structSameName2{}
err := copier.Copy(obj2, &obj1)
log.Println(err)
}
Running this will lead to panic:
panic: reflect: call of reflect.Value.FieldByName on slice Value
Not sure if this is a bug, but it won't panic in an old e15f8e2a. And thanks for your time on this project :)
It's a bit similar to #17:
Running this will lead to panic:
panic: reflect: call of reflect.Value.FieldByName on slice Value
Not sure if this is a bug, but it won't panic in an old e15f8e2a. And thanks for your time on this project :)