1
0
mirror of https://github.com/golang/go synced 2024-11-23 17:40:03 -07:00

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 <gri@golang.org>
This commit is contained in:
Daniel Martí 2018-02-04 09:25:55 +00:00 committed by Robert Griesemer
parent 945872e5ef
commit 06a795e478

View File

@ -438,26 +438,26 @@ func (t *Named) AddMethod(m *Func) {
// Implementations for Type methods. // Implementations for Type methods.
func (t *Basic) Underlying() Type { return t } func (b *Basic) Underlying() Type { return b }
func (t *Array) Underlying() Type { return t } func (a *Array) Underlying() Type { return a }
func (t *Slice) Underlying() Type { return t } func (s *Slice) Underlying() Type { return s }
func (t *Struct) Underlying() Type { return t } func (s *Struct) Underlying() Type { return s }
func (t *Pointer) Underlying() Type { return t } func (p *Pointer) Underlying() Type { return p }
func (t *Tuple) Underlying() Type { return t } 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 *Interface) Underlying() Type { return t }
func (t *Map) Underlying() Type { return t } func (m *Map) Underlying() Type { return m }
func (t *Chan) Underlying() Type { return t } func (c *Chan) Underlying() Type { return c }
func (t *Named) Underlying() Type { return t.underlying } func (t *Named) Underlying() Type { return t.underlying }
func (t *Basic) String() string { return TypeString(t, nil) } func (b *Basic) String() string { return TypeString(b, nil) }
func (t *Array) String() string { return TypeString(t, nil) } func (a *Array) String() string { return TypeString(a, nil) }
func (t *Slice) String() string { return TypeString(t, nil) } func (s *Slice) String() string { return TypeString(s, nil) }
func (t *Struct) String() string { return TypeString(t, nil) } func (s *Struct) String() string { return TypeString(s, nil) }
func (t *Pointer) String() string { return TypeString(t, nil) } func (p *Pointer) String() string { return TypeString(p, nil) }
func (t *Tuple) String() string { return TypeString(t, 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 *Interface) String() string { return TypeString(t, nil) }
func (t *Map) String() string { return TypeString(t, nil) } func (m *Map) String() string { return TypeString(m, nil) }
func (t *Chan) String() string { return TypeString(t, nil) } func (c *Chan) String() string { return TypeString(c, nil) }
func (t *Named) String() string { return TypeString(t, nil) } func (t *Named) String() string { return TypeString(t, nil) }