mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
reflect: ignore struct tags when converting structs
Implementation of spec change https://golang.org/cl/24190/. For #16085. Change-Id: Ib7cb513354269282dfad663c7d2c6e624149f3cd Reviewed-on: https://go-review.googlesource.com/30191 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
f5b0012362
commit
ddb77100a6
3 changed files with 63 additions and 19 deletions
|
|
@ -2239,14 +2239,14 @@ func convertOp(dst, src *rtype) func(Value, Type) Value {
|
|||
}
|
||||
|
||||
// dst and src have same underlying type.
|
||||
if haveIdenticalUnderlyingType(dst, src) {
|
||||
if haveIdenticalUnderlyingType(dst, src, false) {
|
||||
return cvtDirect
|
||||
}
|
||||
|
||||
// dst and src are unnamed pointer types with same underlying base type.
|
||||
if dst.Kind() == Ptr && dst.Name() == "" &&
|
||||
src.Kind() == Ptr && src.Name() == "" &&
|
||||
haveIdenticalUnderlyingType(dst.Elem().common(), src.Elem().common()) {
|
||||
haveIdenticalUnderlyingType(dst.Elem().common(), src.Elem().common(), false) {
|
||||
return cvtDirect
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue