Commit 47435b1d authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

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: default avatarIan Lance Taylor <iant@golang.org>
parent 4869ec00
...@@ -14,8 +14,6 @@ import ( ...@@ -14,8 +14,6 @@ import (
"unsafe" "unsafe"
) )
type MyBuffer bytes.Buffer
func TestImplicitMapConversion(t *testing.T) { func TestImplicitMapConversion(t *testing.T) {
// Test implicit conversions in MapIndex and SetMapIndex. // Test implicit conversions in MapIndex and SetMapIndex.
{ {
...@@ -102,10 +100,7 @@ func TestImplicitMapConversion(t *testing.T) { ...@@ -102,10 +100,7 @@ func TestImplicitMapConversion(t *testing.T) {
} }
{ {
// convert identical underlying types // convert identical underlying types
// TODO(rsc): Should be able to define MyBuffer here. type MyBuffer bytes.Buffer
// 6l prints very strange messages about .this.Bytes etc
// when we do that though, so MyBuffer is defined
// at top level.
m := make(map[*MyBuffer]*bytes.Buffer) m := make(map[*MyBuffer]*bytes.Buffer)
mv := ValueOf(m) mv := ValueOf(m)
b1 := new(MyBuffer) b1 := new(MyBuffer)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment