Skip to content

Commit 76cf862

Browse files
committed
reflect: implement StructOf
This change exposes a facility to create new struct types from a slice of reflect.StructFields. - reflect: first stab at implementing StructOf - reflect: tests for StructOf Creating struct types with embedded interfaces with unexported methods is not supported yet and will panic. Binaries' sizes for linux_amd64: old=tip (0104a31) old bytes new bytes delta bin/go 9911336 9915456 +0.04% reflect 781704 830048 +6.18% Updates golang#5748. Change-Id: I3b8fd4fadd6ce3b1b922e284f0ae72a3a8e3ce44
1 parent ca72f5f commit 76cf862

File tree

3 files changed

+882
-2
lines changed

3 files changed

+882
-2
lines changed

src/cmd/compile/internal/gc/reflect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ ok:
13021302
// we want be able to find.
13031303
if t.Sym == nil {
13041304
switch t.Etype {
1305-
case TPTR32, TPTR64, TARRAY, TCHAN, TFUNC, TMAP:
1305+
case TPTR32, TPTR64, TARRAY, TCHAN, TFUNC, TMAP, TSTRUCT:
13061306
slink := typelinksym(t)
13071307
dsymptr(slink, 0, s, 0)
13081308
ggloblsym(slink, int32(Widthptr), int16(dupok|obj.RODATA))

0 commit comments

Comments
 (0)