🎨 优化项目结构 && 完善ai配置

This commit is contained in:
2026-03-03 15:39:23 +08:00
parent 557c865948
commit 2714e63d2a
585 changed files with 62223 additions and 100018 deletions

View File

@@ -0,0 +1,32 @@
package ast
import (
"git.echol.cn/loser/ai_proxy/server/global"
"go/ast"
"go/parser"
"go/printer"
"go/token"
"os"
"path/filepath"
"testing"
)
func TestAst(t *testing.T) {
filename := filepath.Join(global.GVA_CONFIG.AutoCode.Root, global.GVA_CONFIG.AutoCode.Server, "plugin", "gva", "plugin.go")
fileSet := token.NewFileSet()
file, err := parser.ParseFile(fileSet, filename, nil, parser.ParseComments)
if err != nil {
t.Error(err)
return
}
err = ast.Print(fileSet, file)
if err != nil {
t.Error(err)
return
}
err = printer.Fprint(os.Stdout, token.NewFileSet(), file)
if err != nil {
panic(err)
}
}