Interface 在Go中的接口中列出接口

Interface 在Go中的接口中列出接口,interface,go,Interface,Go,我不理解容器/堆包中的以下代码片段 type Interface interface { sort.Interface //Is this line a method? Push(x interface{}) Pop() interface{} } 这是一个类型声明 heap.Interface接口嵌入了sort.Interface接口 您可以将其视为一种继承/专门化:这意味着实现堆.Interface接口的结构被定义为实现排序.Interface方法和推送和弹出方

我不理解
容器/堆
包中的以下代码片段

type Interface interface {
    sort.Interface   //Is this line a method?
    Push(x interface{})
    Pop() interface{}
}

这是一个类型声明

heap.Interface
接口嵌入了
sort.Interface
接口

您可以将其视为一种继承/专门化:这意味着实现
堆.Interface
接口的结构被定义为实现
排序.Interface
方法和
推送
弹出
方法的结构

接口嵌入在有效Go中描述: