From 8bfe653df8efa2759a559a02f546b0c70a534a4c Mon Sep 17 00:00:00 2001 From: Bo Du Date: Tue, 20 Jun 2017 11:15:19 -0400 Subject: [PATCH] Use go_package option as base path. --- protoc-gen-grpc-gateway/gengateway/generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protoc-gen-grpc-gateway/gengateway/generator.go b/protoc-gen-grpc-gateway/gengateway/generator.go index d08609bc729..9520d2cddcb 100644 --- a/protoc-gen-grpc-gateway/gengateway/generator.go +++ b/protoc-gen-grpc-gateway/gengateway/generator.go @@ -77,7 +77,7 @@ func (g *generator) Generate(targets []*descriptor.File) ([]*plugin.CodeGenerato glog.Errorf("%v: %s", err, code) return nil, err } - name := file.GetName() + name := file.GoPkg.Path ext := filepath.Ext(name) base := strings.TrimSuffix(name, ext) output := fmt.Sprintf("%s.pb.gw.go", base)