文件名称:aster:轻松获取golang语法树并修改代码
文件大小:264KB
文件格式:ZIP
更新时间:2024-05-20 18:07:09
Go
紫ster 轻松获取golang语法树并修改代码。 特征 像在运行时一样将AST转换为reflect.Type类的类型(Kind-Flags) 收集并打包通用语法节点类型 提供易于使用的遍历语法节点功能 轻松获取和修改语法节点信息 格式化输出修改后的代码 更简单,更自然的元编程方式 ... 转到版本 ≥go1.11 一个例子 设置结构标签 package main import ( "flag" "fmt" "github.com/henrylee2cn/aster/aster" "github.com/henrylee2cn/goutil" ) var ( filename = flag . String ( "filename" , "out/eg.structtag.go" , "file name" ) src = flag . String ( "src
【文件预览】:
aster-master
----.gitignore(227B)
----go.mod(201B)
----doc.go(712B)
----Makefile(550B)
----.travis.yml(318B)
----LICENSE(11KB)
----tools()
--------tools.go(5KB)
--------tools_test.go(3KB)
----README.md(3KB)
----.coveralls.yml(25B)
----_examples()
--------structtag()
--------examples_test.go(952B)
----aster()
--------interface.go(2KB)
--------struct.go(8KB)
--------program.go(11KB)
--------inspect.go(5KB)
--------invalid.go(1KB)
--------facade_test.go(3KB)
--------signature.go(5KB)
--------inspect_test.go(1KB)
--------package.go(5KB)
--------facade.go(13KB)
--------file.go(2KB)
--------util.go(3KB)
--------file_test.go(1KB)
--------mixer.go(3KB)
--------struct_test.go(2KB)
--------interface_test.go(1KB)
--------mixer_test.go(2KB)
--------format.go(5KB)
--------kind.go(3KB)
--------kind_string.go(1KB)
--------signature_test.go(3KB)
----README_ZH.md(2KB)
----internal()
--------astutil()
--------gcexportdata()
--------packagesdriver()
--------semver()
--------packages()
--------fastwalk()
--------module()
--------buildutil()
--------cgo()
--------gopathwalk()
--------loader()
--------gcimporter()
--------imports()