mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: remove uncommonType.name
Reduces binary size of cmd/go by 0.5%. For #6853. Change-Id: I5a4b814049580ab5098ad252d979f80b70d8a5f9 Reviewed-on: https://go-review.googlesource.com/19694 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
c8ae2e82c7
commit
0231f5420f
6 changed files with 84 additions and 21 deletions
|
|
@ -5007,3 +5007,24 @@ func TestChanAlloc(t *testing.T) {
|
|||
// a limitation of escape analysis. If that is ever fixed the
|
||||
// allocs < 0.5 condition will trigger and this test should be fixed.
|
||||
}
|
||||
|
||||
type nameTest struct {
|
||||
v interface{}
|
||||
want string
|
||||
}
|
||||
|
||||
var nameTests = []nameTest{
|
||||
{int32(0), "int32"},
|
||||
{D1{}, "D1"},
|
||||
{[]D1{}, ""},
|
||||
{(chan D1)(nil), ""},
|
||||
{(func() D1)(nil), ""},
|
||||
}
|
||||
|
||||
func TestNames(t *testing.T) {
|
||||
for _, test := range nameTests {
|
||||
if got := TypeOf(test.v).Name(); got != test.want {
|
||||
t.Errorf("%T Name()=%q, want %q", test.v, got, test.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue