Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义模板生成报错 #1358

Open
XiaoYi-byte opened this issue May 25, 2024 · 1 comment
Open

自定义模板生成报错 #1358

XiaoYi-byte opened this issue May 25, 2024 · 1 comment
Assignees

Comments

@XiaoYi-byte
Copy link
Contributor

Describe the bug
使用kitex自定义模板生成报错
img_v3_02b7_b2f0ec07-1909-4ba0-9312-2793085d6e6g
生成的目录结构
img_v3_02b7_cf7baa41-65a9-465e-96ed-8a798c67faag
_default.go中的内容
image

PackageInfo.RealServiceName由tool/internal_package/generator/generator.go中的Config.ServiceName赋值,Config.ServiceName是通过-service参数指定的,但是-service参数和-template-dir是不能同时指定的,这好像矛盾了?

To Reproduce
创建两个文件夹tpl和idl,在idl中创建hello.thrift,tpl中创建default.yaml

// hello.thrift
namespace go api

struct Request {
    1: string message
}

struct Response {
    1: string message
}

service Hello {
    Response echo(1: Request req)
}

tpl/default.yaml用的是https://github.com/cloudwego/cwgo/blob/main/tpl/kitex/client/standard/default_tpl.yaml
运行命令 kitex -module github.com/xxx/demo -service demo -template-dir tpl idl/hello.thrift
Expected behavior

正确生成自定义模板

Kitex version:

v0.9.1

@HeyJavaBean
Copy link
Member

cwgo这里的例子单独使用会有点问题。模板相关功能近期我们有计划整体优化+完善文档,后续我们会统一处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants