You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 e15f8e2. And thanks for your time on this project :)
The text was updated successfully, but these errors were encountered:
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 e15f8e2. And thanks for your time on this project :)
The text was updated successfully, but these errors were encountered: