1
0
mirror of https://github.com/golang/go synced 2024-09-24 23:20:12 -06:00

reflect: rename, document TestUnaddressableField

Change-Id: I94e0f3e4bccd44a67934ddb4d5fc7da57bb8ac9f
Reviewed-on: https://go-review.googlesource.com/33112
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
David Crawshaw 2016-11-10 19:02:07 -05:00
parent 53aec79ce0
commit 66477ec830

View File

@ -5914,8 +5914,13 @@ func TestSwapper(t *testing.T) {
}
}
func TestInaccessibleField(t *testing.T) {
var b Buffer
// TestUnaddressableField tests that the reflect package will not allow
// a type from another package to be used as a named type with an
// unexported field.
//
// This ensures that unexported fields cannot be modified by other packages.
func TestUnaddressableField(t *testing.T) {
var b Buffer // type defined in reflect, a different package
var localBuffer struct {
buf []byte
}