1
0
mirror of https://github.com/golang/go synced 2024-11-07 10:26:20 -07:00

go/doc: mark comparable predeclared

Add comparable to the list of predeclared types.

Fixes golang/go#51141.

Change-Id: I4a2d4e7e5680e115de9bca03b6c8ad454551cb82
Reviewed-on: https://go-review.googlesource.com/c/go/+/385114
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Jonathan Amsterdam 2022-02-11 08:54:29 -05:00
parent e50f0f372b
commit f2ec001845
5 changed files with 19 additions and 0 deletions

View File

@ -927,6 +927,7 @@ var predeclaredTypes = map[string]bool{
"any": true,
"bool": true,
"byte": true,
"comparable": true,
"complex64": true,
"complex128": true,
"error": true,

View File

@ -46,6 +46,9 @@ VARIABLES
FUNCTIONS
// Associated with comparable type if AllDecls is set.
func ComparableFactory() comparable
//
func F(x int) int

View File

@ -38,6 +38,12 @@ TYPES
//
func (x *T) M()
// Should only appear if AllDecls is set.
type comparable struct{} // overrides a predeclared type comparable
// Associated with comparable type if AllDecls is set.
func ComparableFactory() comparable
//
type notExported int

View File

@ -46,6 +46,9 @@ VARIABLES
FUNCTIONS
// Associated with comparable type if AllDecls is set.
func ComparableFactory() comparable
//
func F(x int) int

View File

@ -27,9 +27,15 @@ func UintFactory() uint {}
// Associated with uint type if AllDecls is set.
func uintFactory() uint {}
// Associated with comparable type if AllDecls is set.
func ComparableFactory() comparable {}
// Should only appear if AllDecls is set.
type uint struct{} // overrides a predeclared type uint
// Should only appear if AllDecls is set.
type comparable struct{} // overrides a predeclared type comparable
// ----------------------------------------------------------------------------
// Exported declarations associated with non-exported types must always be shown.