Merge remote-tracking branch 'upstream/master' into master

* upstream/master:
  Panic when copying private properties.

Fixes: 126917357
Test: m checkbuild
Change-Id: I34a7fd48c99c80cdbaadf547a7e9d84f180a6108
This commit is contained in:
Jaewoong Jung 2019-03-08 13:13:58 -08:00
commit 9e75985c0d

View file

@ -35,8 +35,7 @@ func CopyProperties(dstValue, srcValue reflect.Value) {
for i, field := range typeFields(typ) {
if field.PkgPath != "" {
// The field is not exported so just skip it.
continue
panic(fmt.Errorf("can't copy a private field %q", field.Name))
}
srcFieldValue := srcValue.Field(i)