package doc
import
type Filter func(string) bool
func ( *ast.FieldList, Filter) bool {
if != nil {
for , := range .List {
for , := range .Names {
if (.Name) {
return true
}
}
}
}
return false
}
func ( *ast.GenDecl, Filter) bool {
for , := range .Specs {
switch v := .(type) {
case *ast.ValueSpec:
for , := range .Names {
if (.Name) {
return true
}
}
case *ast.TypeSpec:
if (.Name.Name) {
return true
}
switch t := .Type.(type) {
case *ast.StructType:
if matchFields(.Fields, ) {
return true
}
case *ast.InterfaceType:
if matchFields(.Methods, ) {
return true
}
}
}
}
return false
}
func ( []*Value, Filter) []*Value {
:= 0
for , := range {
if matchDecl(.Decl, ) {
[] =
++
}
}
return [0:]
}
func ( []*Func, Filter) []*Func {
:= 0
for , := range {
if (.Name) {
[] =
++
}
}
return [0:]
}
func ( []*Type, Filter) []*Type {
:= 0
for , := range {
:= 0
if matchDecl(.Decl, ) {
= 1
} else {
.Consts = filterValues(.Consts, )
.Vars = filterValues(.Vars, )
.Funcs = filterFuncs(.Funcs, )
.Methods = filterFuncs(.Methods, )
+= len(.Consts) + len(.Vars) + len(.Funcs) + len(.Methods)
}
if > 0 {
[] =
++
}
}
return [0:]
}
func ( *Package) ( Filter) {
.Consts = filterValues(.Consts, )
.Vars = filterValues(.Vars, )
.Types = filterTypes(.Types, )
.Funcs = filterFuncs(.Funcs, )
.Doc = ""
}