Skip to content

生成 model 文件路径不符合预期 #1154

@sscui

Description

@sscui

Describe the bug

我在 proto 文件中定义了 go_packages,然后我使用 hz update 去生成相应的model文件,结果生成的文件路径与我在 proto 定义的文件路径不符

Replay
我的项目名为 hello

  1. 创建 idl/hello/hello.proto 文件
  2. 将 demo 中的文件内容复制进去
  3. 编辑 go_packages 路径(只要路径中包含 “hello”子字串即可,此处假设为 hertz/hello1 )
  4. 运行 hz new -module hello -I idl -idl idl/hello/hello.proto
  5. hello.pb.go 预期应该生成在 biz/model 下的 hertz/hello1 文件夹。但是实际上却是在 biz/model 的根目录下
  6. 编辑 go_packages 路径更新为 hertz/hell
  7. 运行 hz update -I idl -idl idl/hello/hello.proto
  8. 实际运行结果如预期:hello.pb.go 生成在 biz/model 下的 hertz/hell 文件夹

Note
只要我的go_packages 路径中包含或者等于 hello,这个实际生成的 pb 文件路径就会有问题

Hertz version:

hz -version
hz version v0.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    tooltool related issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions