[go] cmd/doc: prefer non-internal packages in shorthand lookup

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
2:43 PM (2 hours ago) 2:43 PM
to Goutam, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Damien Neil, Hongxiang Jiang, Jonathan Amsterdam, Alan Donovan, golang...@luci-project-accounts.iam.gserviceaccount.com, Emmanuel Odeke, Michael Matloob, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
cmd/doc: prefer non-internal packages in shorthand lookup

When resolving a shorthand package path, go doc previously returned the
first matching suffix. That let internal/synctest win over
testing/synctest for synctest.Wait because the internal package appears
earlier in the directory scan.

Defer internal package matches unless the query explicitly contains an
internal path element. If no non-internal match is found, keep returning
the deferred internal matches so fallback behavior still works.

Fixes #79988
Change-Id: I98e6ddf789519228cabdad240864c622f2ca47ad
GitHub-Last-Rev: 1f6d424bc42a8a472d464fefb70aaf68e3de374d
GitHub-Pull-Request: golang/go#80002
Reviewed-by: Jonathan Amsterdam <j...@google.com>
Auto-Submit: Alan Donovan <adon...@google.com>
Reviewed-by: Emmanuel Odeke <emma...@orijtech.com>
Reviewed-by: Hongxiang Jiang <hxj...@golang.org>
Reviewed-by: Alan Donovan <adon...@google.com>
Reviewed-by: Damien Neil <dn...@google.com>
Files:
  • M src/cmd/go/internal/doc/doc.go
  • M src/cmd/go/internal/doc/doc_test.go
  • A src/cmd/go/testdata/script/doc_internal.txt
Change size: M
Delta: 3 files changed, 154 insertions(+), 48 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I98e6ddf789519228cabdad240864c622f2ca47ad
Gerrit-Change-Number: 790520
Gerrit-PatchSet: 8
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
Gerrit-Reviewer: Jonathan Amsterdam <j...@google.com>
Gerrit-CC: Goutam <workwit...@gmail.com>
Gerrit-CC: Michael Matloob <mat...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages