Skip to content

Commit

Permalink
fix: generated pb mod name
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Nov 11, 2021
1 parent aa01604 commit 449c8d9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions example/grpc-service/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func main() {
xservice.Name("grpc-service"),
xservice.Version("v1.0.0"),
xservice.Description("example grpc service with enable grpc gateway"),
xservice.WithGrpcServerEnableReflection(true), // optional
)

server := srv.Server()
Expand Down
4 changes: 2 additions & 2 deletions tools/xservice/gogen/assets/project/cmd/main.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/xinpianchang/xservice/core/xservice"
"github.com/xinpianchang/xservice/pkg/swaggerui"

gen "{{.Module}}/pb/gen"
v1 "{{.Module}}/pb/gen/v1"
gen "{{.Module}}_pb/gen"
v1 "{{.Module}}_pb/gen/v1"

"{{.Module}}/service"
"{{.Module}}/version"
Expand Down
2 changes: 1 addition & 1 deletion tools/xservice/gogen/assets/project/go.mod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ require (
github.com/xinpianchang/xservice latest
)

replace {{.Module}}/pb => ./pb
replace {{.Module}}_pb => ./pb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";

package buf.v1;
option go_package = "{{.Module}}/pb/gen/v1";
option go_package = "{{.Module}}_pb/gen/v1";

import "google/api/httpbody.proto";
import "google/api/annotations.proto";
Expand Down
2 changes: 1 addition & 1 deletion tools/xservice/gogen/assets/project/pb/go.mod.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module {{.Module}}/pb
module {{.Module}}_pb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

pb "{{.Module}}/pb/gen/v1"
pb "{{.Module}}_pb/gen/v1"
)

type HelloWorldServiceServerImpl struct{}
Expand Down

0 comments on commit 449c8d9

Please sign in to comment.