From 3cc8d9412681de1e1a1d99629c08c0115ed768e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=98=8E=E4=BF=8A?= Date: Sun, 3 Jan 2021 20:01:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(proto):=20=E4=BD=BF=E7=94=A8google=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=B1=BB=E6=97=B6=E7=9A=84=E6=8A=A5=E9=94=99=20(#678)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tool/kratos-protoc/ecode.go | 7 ++++++- tool/kratos-protoc/grpc.go | 7 ++++++- tool/kratos-protoc/swagger.go | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tool/kratos-protoc/ecode.go b/tool/kratos-protoc/ecode.go index 2f6a3f932..eed3cf367 100644 --- a/tool/kratos-protoc/ecode.go +++ b/tool/kratos-protoc/ecode.go @@ -6,7 +6,12 @@ import ( const ( _getEcodeGen = "go get -u github.com/go-kratos/kratos/tool/protobuf/protoc-gen-ecode" - _ecodeProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --ecode_out=:." + _ecodeProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --ecode_out=" + + "Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types:." ) func installEcodeGen() error { diff --git a/tool/kratos-protoc/grpc.go b/tool/kratos-protoc/grpc.go index 760f29574..f81cdcd12 100644 --- a/tool/kratos-protoc/grpc.go +++ b/tool/kratos-protoc/grpc.go @@ -6,7 +6,12 @@ import ( const ( _getGRPCGen = "go get -u github.com/gogo/protobuf/protoc-gen-gofast" - _grpcProtoc = `protoc --proto_path=%s --proto_path=%s --proto_path=%s --gofast_out=plugins=grpc:.` + _grpcProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --gofast_out=plugins=grpc," + + "Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types:." ) func installGRPCGen() error { diff --git a/tool/kratos-protoc/swagger.go b/tool/kratos-protoc/swagger.go index 7d61e6b28..b0f529a5a 100644 --- a/tool/kratos-protoc/swagger.go +++ b/tool/kratos-protoc/swagger.go @@ -6,7 +6,12 @@ import ( const ( _getSwaggerGen = "go get -u github.com/go-kratos/kratos/tool/protobuf/protoc-gen-bswagger" - _swaggerProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --bswagger_out=:." + _swaggerProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --bswagger_out=" + + "Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types," + + "Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types:." ) func installSwaggerGen() error {