定义为:
//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
包用于文档目的。它并不是真正进口的。根据包文档:内置包文档说:
类型声明
type comparable interface{ comparable }
实际上并不在包中。它只是用于附加文档的占位符。