mirror of
https://github.com/golang/go
synced 2024-09-25 01:20:13 -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:
parent
53aec79ce0
commit
66477ec830
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user