1.3 KiB
1.3 KiB
Go 包生成工具
这个工具会批量读取 thrift-files/meowment-network 下的所有 thrift 文件,并生成一个统一的 Go 包目录。
默认输出位置:
- compiled_output/golang/meowmentnet
默认行为:
- 自动优先使用仓库内的 compiler/exe/thrift.exe
- 如果仓库内编译器不可用,则回退到系统 PATH 中的 thrift
- 将全部 thrift 文件生成到同一个 Go package: meowmentnet
- 启用 ignore_initialisms,保留 Id、Uid 这类字段写法,不自动改成 ID、UID
- 生成完成后自动运行 gofmt
- 使用 --module 时会自动执行 go mod tidy
直接运行:
PythonWorkSpace\IntegratedTool\启动Go包生成工具.bat
常见参数:
PythonWorkSpace\IntegratedTool\启动Go包生成工具.bat --output-dir D:\temp\meowmentnet
PythonWorkSpace\IntegratedTool\启动Go包生成工具.bat --package-name netpkg
PythonWorkSpace\IntegratedTool\启动Go包生成工具.bat --module github.com/yourname/meowmentnet
PythonWorkSpace\IntegratedTool\启动Go包生成工具.bat --compiler F:\Github\thrift\thrift.exe
如果你想把生成结果直接作为一个独立 Go module 使用,建议同时传入:
PythonWorkSpace\IntegratedTool\启动Go包生成工具.bat --module github.com/yourname/meowmentnet --output-dir D:\work\meowmentnet