Describe the bug
wrong proto.PbPackage parameter in call.tpl name on generating rpc service by goctl
To Reproduce
Steps to reproduce the behavior, if applicable:
- this is part of my proto definition:
syntax = "proto3";
package ipncore;
option go_package = ".;ipncore";
// empty message
message Empty {}
// Common types
message Subnet {
string id = 1;
string name = 2;
string cidr_block = 3;
}
// Request types
message ListSubnetsRequest {}
// Response types
message ListSubnetsResponse {
repeated Subnet subnets = 1;
}
// Subnet-related service group
service SubnetService {
rpc ListSubnets(ListSubnetsRequest) returns (ListSubnetsResponse);
}
and my package name in go.mod file is git.chinternal.com/ipn/ipn-core
- this is the genrated rpc service code in some files:
testrpc/client/subnetservice/subnetservice.go
// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.3
// Source: testrpc.proto
package subnetservice
import (
"context"
"git.chinternal.com/ipn/ipn-testrpc/pb"
"github.com/zeromicro/go-zero/zrpc"
"google.golang.org/grpc"
)
type (
Empty = ___ipncore.Empty
ListSubnetsRequest = ___ipncore.ListSubnetsRequest
ListSubnetsResponse = ___ipncore.ListSubnetsResponse
Subnet = ___ipncore.Subnet
SubnetService interface {
ListSubnets(ctx context.Context, in *ListSubnetsRequest, opts ...grpc.CallOption) (*ListSubnetsResponse, error)
}
defaultSubnetService struct {
cli zrpc.Client
}
)
func NewSubnetService(cli zrpc.Client) SubnetService {
return &defaultSubnetService{
cli: cli,
}
}
func (m *defaultSubnetService) ListSubnets(ctx context.Context, in *ListSubnetsRequest, opts ...grpc.CallOption) (*ListSubnetsResponse, error) {
client := ___ipncore.NewSubnetServiceClient(m.cli.Conn())
return client.ListSubnets(ctx, in, opts...)
}
Expected behavior
i think the name of pb package in these files must be ipncore instead of ___ipncore:
testrpc/internal/logic/subnetservice/listsubnetslogic.go testrpc/testrpc.go testrpc/client/subnetservice/subnetservice.go testrpc/internal/server/subnetservice/subnetserviceserver.go
Screenshots
Environments (please complete the following information):
- OS: ubuntu 22.04
- go-zero version 1.7.6
- goctl version 1.7.5
Describe the bug
wrong
proto.PbPackageparameter incall.tplname on generating rpc service by goctlTo Reproduce
Steps to reproduce the behavior, if applicable:
and my package name in go.mod file is
git.chinternal.com/ipn/ipn-coretestrpc/client/subnetservice/subnetservice.go
Expected behavior
i think the name of pb package in these files must be
ipncoreinstead of___ipncore:testrpc/internal/logic/subnetservice/listsubnetslogic.go testrpc/testrpc.go testrpc/client/subnetservice/subnetservice.go testrpc/internal/server/subnetservice/subnetserviceserver.goScreenshots
Environments (please complete the following information):