internal/lib/reflect: type.Field FieldByIndex FieldByName

This commit is contained in:
visualfc
2024-09-05 21:27:40 +08:00
parent e085fd1d57
commit 9eb9b48534
19 changed files with 9780 additions and 8688 deletions

View File

@@ -321,8 +321,11 @@ func (b *Builder) structHash(t *types.Struct) (ret []byte, private bool) {
if f.Embedded() {
name = "-"
}
ft, _ := b.TypeName(f.Type())
ft, pub := b.TypeName(f.Type())
fmt.Fprintln(h, name, ft)
if !pub {
private = true
}
}
ret = h.Sum(b.buf[:0])
return