Skip to content

Generated project is not working when there are digits in the name #4027

Closed
@77409

Description

@77409

Describe the bug
当创建的项目名字中包含数字(Have numbers in project name)时,如:e4tingdo1thing,示例代码无法运行,生成的代码大小写是混乱的。
主要体现在:数字后的第一个字母的大小写看起来是随机的。

To Reproduce
Steps to reproduce the behavior, if applicable:

  1. The code is

    goctl rpc new e4ting
    cd e4ting
    go  build -o test e4ting.go  
  2. The error is

     internal/server/e4tingserver.go:16:9: undefined: e4ting.UnimplementedE4tingServer
     ./e4ting.go:29:50: undefined: server.NewE4TingServer
    
    // e4ting_grpc.pb.go 中  4 后面的字母t是大写(Upper)的
    type UnimplementedE4TingServer struct {
    }
    // e4tingserver.go 中  4 后面的字母t是小写(Lower)的
    func NewE4tingServer(svcCtx *svc.ServiceContext) *E4tingServer {
        return &E4tingServer{
    	    svcCtx: svcCtx,
        }
    }

Expected behavior
全英文时,是不会出现上面的报错的.

Screenshots

Environments (please complete the following information):

  • OS: Linux
  • goctl version 1.6.3

More description
.

Metadata

Metadata

Assignees

Labels

area/goctlCategorizes issue or PR as related to goctl.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions