]> Cypherpunks repositories - gostls13.git/commit
reflect: remove struct tags from unexported types
authorIan Lance Taylor <iant@golang.org>
Thu, 28 Jun 2018 22:44:41 +0000 (15:44 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 28 Jun 2018 23:06:00 +0000 (23:06 +0000)
commit997d7a1893ae15df1438c46487dd69903f16c57f
treefdf8c0e494e2bb86e3441a240bf17f33f562a73d
parentb410ce750e08f3b62af3d3d277fa0793f11ed674
reflect: remove struct tags from unexported types

Before CL 4281055 in 2011, the reflect package was quite different.
rtype, then called commonType, was embedded in exported structs with
names like StructType. In order to avoid accidental conversions
between pointers to these public structs, which sometimes had
identical fields, the embedded commonType fields were tagged.

In CL 4281055 the formerly public structs were unexported, and all
access was done through the Type interface. At that point the field
tags in the reflect structs were no longer useful.

In Go 1.8 the language was changed to ignore struct field tags when
converting between types. This made the field tags in the reflect
structs doubly useless.

This CL simply removes them.

Fixes #20914

Change-Id: I9af4d6d0709276a91a6b6ee5323cad9dcd0cd0a0
Reviewed-on: https://go-review.googlesource.com/121475
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/reflect/type.go