aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2018-04-18 11:52:39 +0200
committerTobias Klauser <tobias.klauser@gmail.com>2018-04-18 12:47:39 +0000
commit47435b1da1e2a5698d1cfddc0eff889e4fdb6111 (patch)
tree0aa110d23895f4dd50b513ad3d46b93a82fe145f /src
parent4869ec00e87ef49db2646c25d28d5c7e4f1caff8 (diff)
downloadgo-47435b1da1e2a5698d1cfddc0eff889e4fdb6111.tar.xz
reflect: define MyBuffer more locally in TestImplicitMapConversion
There are no strange messages anymore, so define type MyBuffer in the block where it is used. Change-Id: Ic65b15dc76a40f6f734d9ac2116338502fbb66fd Reviewed-on: https://go-review.googlesource.com/107735 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/reflect/set_test.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/reflect/set_test.go b/src/reflect/set_test.go
index 7c39623a9d..a633e6eee2 100644
--- a/src/reflect/set_test.go
+++ b/src/reflect/set_test.go
@@ -14,8 +14,6 @@ import (
"unsafe"
)
-type MyBuffer bytes.Buffer
-
func TestImplicitMapConversion(t *testing.T) {
// Test implicit conversions in MapIndex and SetMapIndex.
{
@@ -102,10 +100,7 @@ func TestImplicitMapConversion(t *testing.T) {
}
{
// convert identical underlying types
- // TODO(rsc): Should be able to define MyBuffer here.
- // 6l prints very strange messages about .this.Bytes etc
- // when we do that though, so MyBuffer is defined
- // at top level.
+ type MyBuffer bytes.Buffer
m := make(map[*MyBuffer]*bytes.Buffer)
mv := ValueOf(m)
b1 := new(MyBuffer)