未完成的代码

This commit is contained in:
des
2026-02-26 11:37:56 +08:00
parent 657dc7c3a6
commit 2a35f2f816
2 changed files with 18 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package tool
import (
"fmt"
"go/types"
"os"
"path/filepath"
"strings"
@@ -41,6 +42,18 @@ func main() {
panic(err)
}
for _, pkg := range pkgs {
top := pkg.Types.Scope()
funcs := []*types.Func{}
for _, name := range top.Names() {
obj := top.Lookup(name)
if !strings.HasSuffix(obj.Name(), "Provider") {
continue
}
fun, ok := obj.(*types.Func)
if ok {
funcs = append(funcs, fun)
}
}
fmt.Println(pkg.Name)
}
}