1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 19:43:49 +08:00

fix: fix api-generator panic

This commit is contained in:
wdvxdr 2021-12-28 16:56:36 +08:00
parent a10aee8c8d
commit 05f7eeb5c9
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6

View File

@ -112,7 +112,7 @@ func main() {
for _, decl := range file.Decls {
switch decl := decl.(type) {
case *ast.FuncDecl:
if decl.Recv == nil {
if !decl.Name.IsExported() || decl.Recv == nil {
continue
}
if st, ok := decl.Recv.List[0].Type.(*ast.StarExpr); !ok || st.X.(*ast.Ident).Name != "CQBot" {
@ -137,8 +137,6 @@ func main() {
for _, comment := range decl.Doc.List {
annotation, args := match(comment.Text)
switch annotation {
case "":
continue
case "route":
router.Path = args
case "alias":