Skip to content

Commit

Permalink
Merge pull request #21 from bootun/master
Browse files Browse the repository at this point in the history
update context dependency and fix test case bug
  • Loading branch information
GrantZheng authored Jan 14, 2022
2 parents 87d8ccd + a080d08 commit ce87867
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generator/add_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ func (g *generateGRPCTransport) Generate() (err error) {
n,
jen.Id(stp).Id("*grpcServer"),
[]jen.Code{
jen.Id("ctx").Qual("golang.org/x/net/context", "Context"),
jen.Id("ctx").Qual("context", "Context"),
jen.Id("req").Id("*").Qual(pbImport, n+"Request"),
},
[]jen.Code{
Expand Down
2 changes: 1 addition & 1 deletion generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (b *BaseGenerator) GenerateNameBySample(sample string, exclude []parser.Nam
if v.Name == name {
sn++
if sn > len(sample) {
sample = string(len(sample) - sn)
sample = strconv.Itoa(len(sample) - sn)
}
name = utils.ToLowerFirstCamelCase(sample)[:sn]
}
Expand Down

0 comments on commit ce87867

Please sign in to comment.