refect: Type.String() should use a shortened package name

This commit is contained in:
Damian Gryski
2023-03-07 12:21:17 -08:00
committed by Ron Evans
parent 7a96f0f609
commit 569817a514
2 changed files with 13 additions and 1 deletions
+6
View File
@@ -1,6 +1,7 @@
package reflect_test
import (
"encoding/base64"
. "reflect"
"sort"
"testing"
@@ -264,6 +265,11 @@ func TestNamedTypes(t *testing.T) {
if got, want := ValueOf(m).String(), "<map[[4]uint16]string Value>"; got != want {
t.Errorf("Value.String()=%v, want %v", got, want)
}
if got, want := TypeOf(base64.Encoding{}).String(), "base64.Encoding"; got != want {
t.Errorf("Type.String(base64.Encoding{})=%v, want %v", got, want)
}
}
func TestStruct(t *testing.T) {