mirror of
https://github.com/golang/go
synced 2024-11-07 12:46:16 -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:
parent
e50f0f372b
commit
f2ec001845
@ -927,6 +927,7 @@ var predeclaredTypes = map[string]bool{
|
||||
"any": true,
|
||||
"bool": true,
|
||||
"byte": true,
|
||||
"comparable": true,
|
||||
"complex64": true,
|
||||
"complex128": true,
|
||||
"error": true,
|
||||
|
3
src/go/doc/testdata/b.0.golden
vendored
3
src/go/doc/testdata/b.0.golden
vendored
@ -46,6 +46,9 @@ VARIABLES
|
||||
|
||||
|
||||
FUNCTIONS
|
||||
// Associated with comparable type if AllDecls is set.
|
||||
func ComparableFactory() comparable
|
||||
|
||||
//
|
||||
func F(x int) int
|
||||
|
||||
|
6
src/go/doc/testdata/b.1.golden
vendored
6
src/go/doc/testdata/b.1.golden
vendored
@ -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
|
||||
|
||||
|
3
src/go/doc/testdata/b.2.golden
vendored
3
src/go/doc/testdata/b.2.golden
vendored
@ -46,6 +46,9 @@ VARIABLES
|
||||
|
||||
|
||||
FUNCTIONS
|
||||
// Associated with comparable type if AllDecls is set.
|
||||
func ComparableFactory() comparable
|
||||
|
||||
//
|
||||
func F(x int) int
|
||||
|
||||
|
6
src/go/doc/testdata/b.go
vendored
6
src/go/doc/testdata/b.go
vendored
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user