_content/doc/comment: add note about conflicting package imports
When multiple source files import different packages to the same name, that creates an ambiguity, disallowing the use of the short package name in doc comment links. For golang/go#51082. Change-Id: Id46ca1e2db2c681e02ed34fc4dd57e3e43030994 Reviewed-on: https://go-review.googlesource.com/c/website/+/414694 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Родитель
b1d076a072
Коммит
ecd2fa3d3c
|
@ -634,6 +634,8 @@ this rule should work for essentially all Go code.)
|
|||
For example, if the current package imports encoding/json,
|
||||
then “[json.Decoder]” can be written in place of “[encoding/json.Decoder]”
|
||||
to link to the docs for encoding/json's Decoder.
|
||||
If different source files in a package import different packages using the same name,
|
||||
then the shorthand is ambiguous and cannot be used.
|
||||
|
||||
A “pkg” is only
|
||||
assumed to be a full import path if it starts with a domain name (a
|
||||
|
|
Загрузка…
Ссылка в новой задаче