diff --git a/generator/add_transport.go b/generator/add_transport.go index ec51931..f61b1cc 100644 --- a/generator/add_transport.go +++ b/generator/add_transport.go @@ -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{ diff --git a/generator/generator.go b/generator/generator.go index e8d31da..470c986 100644 --- a/generator/generator.go +++ b/generator/generator.go @@ -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] }