Skip to content

Commit

Permalink
fix:#2002 definition service lowercase generation cannot be exported (#…
Browse files Browse the repository at this point in the history
…2003)

* fix:#2002

* fix:lint
  • Loading branch information
songzhibin97 authored and tonybase committed May 31, 2022
1 parent d6e3fed commit 3375816
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/kratos/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ require (
github.com/fatih/color v1.13.0
github.com/spf13/cobra v1.3.0
golang.org/x/mod v0.5.0
golang.org/x/text v0.3.7
)
7 changes: 6 additions & 1 deletion cmd/kratos/internal/proto/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ import (
"path"
"strings"

"golang.org/x/text/cases"
"golang.org/x/text/language"

"github.com/emicklei/proto"
"github.com/spf13/cobra"
)

var caser = cases.Title(language.English)

// CmdServer the service command.
var CmdServer = &cobra.Command{
Use: "server",
Expand Down Expand Up @@ -60,7 +65,7 @@ func run(cmd *cobra.Command, args []string) {
r, ok := e.(*proto.RPC)
if ok {
cs.Methods = append(cs.Methods, &Method{
Service: s.Name, Name: r.Name, Request: r.RequestType,
Service: s.Name, Name: caser.String(r.Name), Request: r.RequestType,
Reply: r.ReturnsType, Type: getMethodType(r.StreamsRequest, r.StreamsReturns),
})
}
Expand Down

0 comments on commit 3375816

Please sign in to comment.