Goctl rpc patch (#117)
* remove mock generation * add: proto project import * update document * remove mock generation * add: proto project import * update document * remove NL * update document * optimize code * add test * add test
This commit is contained in:
@@ -65,7 +65,7 @@ func (g *defaultRpcGenerator) genMain() error {
|
||||
"serviceName": g.Ctx.ServiceName.Lower(),
|
||||
"srv": srv,
|
||||
"registers": registers,
|
||||
"imports": strings.Join(imports, "\n"),
|
||||
"imports": strings.Join(imports, util.NL),
|
||||
}, fileName, true)
|
||||
}
|
||||
|
||||
@@ -77,5 +77,5 @@ func (g *defaultRpcGenerator) genServer(pkg string, list []*parser.RpcService) (
|
||||
list1 = append(list1, fmt.Sprintf("%sSrv := server.New%sServer(ctx)", name, item.Name.Title()))
|
||||
list2 = append(list2, fmt.Sprintf("%s.Register%sServer(grpcServer, %sSrv)", pkg, item.Name.Title(), name))
|
||||
}
|
||||
return strings.Join(list1, "\n"), strings.Join(list2, "\n")
|
||||
return strings.Join(list1, util.NL), strings.Join(list2, util.NL)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user