]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: rename types.Type.{Short,Long}String to {Link,Name...
authorMatthew Dempsky <mdempsky@google.com>
Fri, 25 Jun 2021 17:04:51 +0000 (10:04 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 25 Jun 2021 23:10:17 +0000 (23:10 +0000)
commit942edc750292060450fda38835c452f6125447c3
treecda8f0643ba64df9760023d818a4e85636fb3b92
parent373ca3a846d64733b0391dcdcc55631904a3c41c
[dev.typeparams] cmd/compile: rename types.Type.{Short,Long}String to {Link,Name}String

The original names "ShortString" and "LongString" refer back to the
fmt verbs used to request their formatting styles. However, I always
get confused working with them, in particular because (1) the
"ShortString" description, which uses package-path qualification, is
actually generally longer than the "LongString" description, which
uses package-name qualification; and (2) the documentation mentions
how they're often used, but doesn't actually describe why they're safe
for those purposes.

This CL renames them to "LinkString" and "NameString", respectively,
based on their primary use cases. It also attempts to more completely
describe the strings they return and how they can be used correctly.

Change-Id: I9158ae3eafa8ac53da31a78c7a6d929dc0199afe
Reviewed-on: https://go-review.googlesource.com/c/go/+/330910
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/noder/reader.go
src/cmd/compile/internal/reflectdata/reflect.go
src/cmd/compile/internal/typecheck/stmt.go
src/cmd/compile/internal/types/fmt.go
src/cmd/compile/internal/types/type.go
src/cmd/compile/internal/walk/order.go