代码拉取完成,页面将自动刷新
package gotype
import (
"bytes"
)
type typeInterface struct {
typeBase
all types
anonymo types
method types
}
func (t *typeInterface) String() string {
buf := bytes.NewBuffer(nil)
buf.WriteString("interface{")
for i, v := range t.all {
if i != 0 {
buf.WriteString("; ")
}
buf.WriteString(v.String())
}
buf.WriteByte('}')
return buf.String()
}
func (t *typeInterface) Kind() Kind {
return Interface
}
func (t *typeInterface) NumMethod() int {
return t.method.Len()
}
func (t *typeInterface) Method(i int) Type {
return t.method.Index(i)
}
func (t *typeInterface) MethodByName(name string) (Type, bool) {
b, ok := t.method.Search(name)
if ok {
return b, true
}
for _, v := range t.anonymo {
v := v.Declaration()
b, ok := v.MethodByName(name)
if ok {
return b, true
}
}
return nil, false
}
func (t *typeInterface) NumField() int {
return t.all.Len()
}
func (t *typeInterface) Field(i int) Type {
return t.all.Index(i)
}
func (t *typeInterface) FieldByName(name string) (Type, bool) {
b, ok := t.all.Search(name)
if ok {
return b, true
}
return nil, false
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。