9 years, 11 months ago
(2014-12-12 21:00:04 UTC)
#3
https://codereview.appspot.com/186270043/diff/60001/cmd/sockdrawer/main.go
File cmd/sockdrawer/main.go (right):
https://codereview.appspot.com/186270043/diff/60001/cmd/sockdrawer/main.go#ne...
cmd/sockdrawer/main.go:823: func recvTypeName(T types.Type) *types.TypeName {
On 2014/12/12 20:13:00, adonovan wrote:
> On 2014/12/12 19:53:23, rsc wrote:
> > It is very unusual in Go to see capitalized local variable names. Please
> > reconsider.
>
> Agreed, but T seems to have become the default name for vars of type
types.Type,
> at least between Robert and I. I have grown quite fond of it.
I'm happy for you both but it's not idiomatic Go and it would be great not to
propagate it further. The convention is that T is an exported package-level
name. 't' seems like it would do just fine for a variable of type types.Type.
The whole point of having conventions is to follow them, not to break them
because you grow fond of something else.
On 2014/12/12 21:00:04, rsc wrote: > I'm happy for you both but it's not idiomatic ...
9 years, 11 months ago
(2014-12-12 21:17:18 UTC)
#4
On 2014/12/12 21:00:04, rsc wrote:
> I'm happy for you both but it's not idiomatic Go and it would be great not to
> propagate it further. The convention is that T is an exported package-level
> name. 't' seems like it would do just fine for a variable of type types.Type.
> The whole point of having conventions is to follow them, not to break them
> because you grow fond of something else.
Ok, if you feel strongly.
To be fair, there's a long tradition of using T to denote a type, and I've never
read or heard about an injunction on using capitalized names for local
identifiers in Go programs, though of course one rarely needs them.
Issue 186270043: cmd/sockdrawer: a tool for package reorganization.
Created 9 years, 11 months ago by adonovan
Modified 9 years, 11 months ago
Reviewers: rsc
Base URL:
Comments: 7