]> Cypherpunks repositories - gostls13.git/commit
reflect: handle types with unexported methods before exported ones
authorAndré Carvalho <asantostc@gmail.com>
Fri, 28 Jul 2017 23:31:20 +0000 (20:31 -0300)
committerIan Lance Taylor <iant@golang.org>
Wed, 23 Aug 2017 23:48:49 +0000 (23:48 +0000)
commit77b4beba2fd892a3f8e9da527fdad031f6ecc613
tree597fc82c2e5d6e5c5608e8949525ed5c886b4232
parente0ab505a97eed8773ea16842f2748b6d518fedd9
reflect: handle types with unexported methods before exported ones

The method Method expects index to be an index of exported fields,
but, before this change, the index used by MethodByName could
take into account unexported fields if those happened sort
before the exported one.

Fixes #21177

Change-Id: I90bb64a47b23e2e43fdd2b8a1e0a2c9a8a63ded2
Reviewed-on: https://go-review.googlesource.com/51810
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/reflect/all_test.go
src/reflect/type.go