[go] cmd/go: show comparable in go doc interface output

1 view
Skip to first unread message

Sean Liao (Gerrit)

unread,
Dec 15, 2025, 10:32:18 AM (yesterday) Dec 15
to Nhan Nguyen, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, David Chase, Michael Matloob, Michael Matloob, Go LUCI, Gopher Robot, golang-co...@googlegroups.com

Sean Liao submitted the change

Change information

Commit message:
cmd/go: show comparable in go doc interface output

The go doc command now displays the comparable constraint when embedded
in an interface, matching the existing behavior for the error type.

Previously, when an interface embedded comparable, it was not shown in
the documentation and incorrectly triggered the "Has unexported methods"
message even when no unexported methods existed.

Fixes #76125
Change-Id: Idaae07fcb1dfc79b1fae374f9fc68df0052ff38e
Reviewed-by: Sean Liao <se...@liao.dev>
Reviewed-by: David Chase <drc...@google.com>
Reviewed-by: Michael Matloob <mat...@google.com>
Reviewed-by: Michael Matloob <mat...@golang.org>
Files:
  • M src/cmd/go/internal/doc/doc_test.go
  • M src/cmd/go/internal/doc/pkg.go
  • M src/cmd/go/internal/doc/testdata/pkg.go
Change size: S
Delta: 3 files changed, 46 insertions(+), 3 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Michael Matloob, +1 by Michael Matloob, +1 by David Chase, +1 by Sean Liao
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
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: Idaae07fcb1dfc79b1fae374f9fc68df0052ff38e
Gerrit-Change-Number: 727100
Gerrit-PatchSet: 2
Gerrit-Owner: Nhan Nguyen <nhan...@gmail.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-CC: Gopher Robot <go...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages