定义为:
//comparable is an interface that is implemented by all comparable types
// (booleans, numbers, strings, pointers, channels, arrays of comparable types,
// structs whose fields are all comparable types).
// The comparable interface may only be used as a type parameter constraint,
// not as the type of a variable.
type comparable interface{ comparable }
定义是什么意思?这不是一个递归接口吗?
builtin
包用于文档目的。它并不是真正进口的。根据包文档:
Packagebuiltin 提供了 Go 预声明标识符的文档。这里记录的项目实际上并不在内置包中,但它们在这里的描述允许 godoc 提供该语言的特殊标识符的文档。
内置包文档说:
Packagebuiltin 提供了 Go 预声明标识符的文档。这里记录的项目实际上并不在内置包中,但它们在这里的描述允许 godoc 提供该语言的特殊标识符的文档。
类型声明
type comparable interface{ comparable }
实际上并不在包中。它只是一个用于附加文档的占位符。