From 06a795e4788f0895c10695e4d89c01ff135f0463 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Sun, 4 Feb 2018 09:25:55 +0000 Subject: [PATCH] go/types: use consistent receiver names Inconsistent names are quite obvious on the godoc HTML rendering: type Array func NewArray(elem Type, len int64) *Array func (a *Array) Elem() Type func (a *Array) Len() int64 func (t *Array) String() string func (t *Array) Underlying() Type Fix all the String and Underlying methods to be consistent with their types. This makes these two lists of methods less consistent, but that's not visible to the user. This also makes the inconsistent receiver names rule in golint happy. Change-Id: I7c84d6bae1235887233a70d5f7f61a224106e952 Reviewed-on: https://go-review.googlesource.com/91736 Reviewed-by: Robert Griesemer --- src/go/types/type.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/go/types/type.go b/src/go/types/type.go index 374966c4ed..50e3c6e4d0 100644 --- a/src/go/types/type.go +++ b/src/go/types/type.go @@ -438,26 +438,26 @@ func (t *Named) AddMethod(m *Func) { // Implementations for Type methods. -func (t *Basic) Underlying() Type { return t } -func (t *Array) Underlying() Type { return t } -func (t *Slice) Underlying() Type { return t } -func (t *Struct) Underlying() Type { return t } -func (t *Pointer) Underlying() Type { return t } +func (b *Basic) Underlying() Type { return b } +func (a *Array) Underlying() Type { return a } +func (s *Slice) Underlying() Type { return s } +func (s *Struct) Underlying() Type { return s } +func (p *Pointer) Underlying() Type { return p } func (t *Tuple) Underlying() Type { return t } -func (t *Signature) Underlying() Type { return t } +func (s *Signature) Underlying() Type { return s } func (t *Interface) Underlying() Type { return t } -func (t *Map) Underlying() Type { return t } -func (t *Chan) Underlying() Type { return t } +func (m *Map) Underlying() Type { return m } +func (c *Chan) Underlying() Type { return c } func (t *Named) Underlying() Type { return t.underlying } -func (t *Basic) String() string { return TypeString(t, nil) } -func (t *Array) String() string { return TypeString(t, nil) } -func (t *Slice) String() string { return TypeString(t, nil) } -func (t *Struct) String() string { return TypeString(t, nil) } -func (t *Pointer) String() string { return TypeString(t, nil) } +func (b *Basic) String() string { return TypeString(b, nil) } +func (a *Array) String() string { return TypeString(a, nil) } +func (s *Slice) String() string { return TypeString(s, nil) } +func (s *Struct) String() string { return TypeString(s, nil) } +func (p *Pointer) String() string { return TypeString(p, nil) } func (t *Tuple) String() string { return TypeString(t, nil) } -func (t *Signature) String() string { return TypeString(t, nil) } +func (s *Signature) String() string { return TypeString(s, nil) } func (t *Interface) String() string { return TypeString(t, nil) } -func (t *Map) String() string { return TypeString(t, nil) } -func (t *Chan) String() string { return TypeString(t, nil) } +func (m *Map) String() string { return TypeString(m, nil) } +func (c *Chan) String() string { return TypeString(c, nil) } func (t *Named) String() string { return TypeString(t, nil) } -- 2.50.0