Skip to content

Commit

Permalink
rewire protoc-gen-gogo
Browse files Browse the repository at this point in the history
  • Loading branch information
wxue committed Nov 15, 2019
1 parent 3630eb9 commit 89b25a1
Show file tree
Hide file tree
Showing 125 changed files with 429 additions and 423 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ contributors:
js:
ifeq (go1.12, $(findstring go1.12, $(GO_VERSION)))
go get -u github.com/gopherjs/gopherjs
gopherjs build github.com/gogo/protobuf/protoc-gen-gogo
gopherjs build github.com/tron-us/protobuf/protoc-gen-gogo
endif

purego:
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Install protoc-gen-gogo:

go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/jsonpb
go get github.com/gogo/protobuf/protoc-gen-gogo
go get github.com/tron-us/protobuf/protoc-gen-gogo
go get github.com/gogo/protobuf/gogoproto

## GRPC
Expand Down
4 changes: 2 additions & 2 deletions gogoproto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

regenerate:
go install github.com/gogo/protobuf/protoc-gen-gogo
protoc --gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:../../../../ --proto_path=../../../../:../protobuf/:. *.proto
go install github.com/tron-us/protobuf/protoc-gen-gogo
protoc --gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/tron-us/protobuf/protoc-gen-gogo/descriptor:../../../../ --proto_path=../../../../:../protobuf/:. *.proto

restore:
cp gogo.pb.golden gogo.pb.go
Expand Down
2 changes: 1 addition & 1 deletion gogoproto/gogo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gogoproto/gogo.pb.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package gogoproto
import proto "github.com/gogo/protobuf/proto"
import json "encoding/json"
import math "math"
import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
import google_protobuf "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"

// Reference proto, json, and math imports to suppress error if they are not otherwise used.
var _ = proto.Marshal
Expand Down
2 changes: 1 addition & 1 deletion gogoproto/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

package gogoproto

import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
import google_protobuf "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
import proto "github.com/gogo/protobuf/proto"

func IsEmbed(field *google_protobuf.FieldDescriptorProto) bool {
Expand Down
2 changes: 1 addition & 1 deletion plugin/compare/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ package compare
import (
"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/gogo/protobuf/vanity"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator"
)

Expand Down
4 changes: 2 additions & 2 deletions plugin/description/description.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ import (
"fmt"
"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator"
)

Expand All @@ -107,7 +107,7 @@ func (p *plugin) Generate(file *generator.FileDescriptor) {
localName := generator.FileName(file)

p.PluginImports = generator.NewPluginImports(p.Generator)
descriptorPkg := p.NewImport("github.com/gogo/protobuf/protoc-gen-gogo/descriptor")
descriptorPkg := p.NewImport("github.com/tron-us/protobuf/protoc-gen-gogo/descriptor")
protoPkg := p.NewImport("github.com/gogo/protobuf/proto")
gzipPkg := p.NewImport("compress/gzip")
bytesPkg := p.NewImport("bytes")
Expand Down
2 changes: 1 addition & 1 deletion plugin/equal/equal.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ package equal
import (
"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/gogo/protobuf/vanity"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator"
)

Expand Down
2 changes: 1 addition & 1 deletion plugin/marshalto/marshalto.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ import (

"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/gogo/protobuf/vanity"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator"
)

Expand Down
2 changes: 1 addition & 1 deletion plugin/populate/populate.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ import (

"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/gogo/protobuf/vanity"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator"
)

Expand Down
2 changes: 1 addition & 1 deletion plugin/size/size.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ import (

"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/gogo/protobuf/vanity"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator"
)

Expand Down
2 changes: 1 addition & 1 deletion plugin/unmarshal/unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ import (

"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator"
)

Expand Down
2 changes: 1 addition & 1 deletion proto/all_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (
. "github.com/gogo/protobuf/proto"
pb3 "github.com/gogo/protobuf/proto/proto3_proto"
. "github.com/gogo/protobuf/proto/test_proto"
descriptorpb "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
descriptorpb "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
)

var globalO *Buffer
Expand Down
2 changes: 1 addition & 1 deletion protobuf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VERSION=3.9.1
URL="https://raw.githubusercontent.com/protocolbuffers/protobuf/v${VERSION}/src/google/protobuf"

regenerate:
go install github.com/gogo/protobuf/protoc-gen-gogotypes
go install github.com/tron-us/protobuf/protoc-gen-gogotypes
go install github.com/gogo/protobuf/protoc-min-version

protoc-min-version \
Expand Down
2 changes: 1 addition & 1 deletion protoc-gen-gogo/descriptor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

regenerate:
go install github.com/gogo/protobuf/protoc-gen-gogo
go install github.com/tron-us/protobuf/protoc-gen-gogo
go install github.com/gogo/protobuf/protoc-gen-gostring
protoc --gogo_out=. -I=../../protobuf/google/protobuf ../../protobuf/google/protobuf/descriptor.proto
protoc --gostring_out=. -I=../../protobuf/google/protobuf ../../protobuf/google/protobuf/descriptor.proto
2 changes: 1 addition & 1 deletion protoc-gen-gogo/descriptor/descriptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

tpb "github.com/gogo/protobuf/proto/test_proto"
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
)

func TestMessage(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions protoc-gen-gogo/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ import (

"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
plugin "github.com/gogo/protobuf/protoc-gen-gogo/plugin"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator/internal/remap"
plugin "github.com/tron-us/protobuf/protoc-gen-gogo/plugin"
)

// generatedCodeVersion indicates a version of the generated code.
Expand Down
4 changes: 2 additions & 2 deletions protoc-gen-gogo/generator/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import (

"github.com/gogo/protobuf/gogoproto"
"github.com/gogo/protobuf/proto"
descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
plugin "github.com/gogo/protobuf/protoc-gen-gogo/plugin"
descriptor "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
plugin "github.com/tron-us/protobuf/protoc-gen-gogo/plugin"
)

func (d *FileDescriptor) Messages() []*Descriptor {
Expand Down
2 changes: 1 addition & 1 deletion protoc-gen-gogo/generator/name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ package generator
import (
"testing"

"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
)

func TestCamelCase(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion protoc-gen-gogo/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"strconv"
"strings"

pb "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
pb "github.com/tron-us/protobuf/protoc-gen-gogo/descriptor"
"github.com/tron-us/protobuf/protoc-gen-gogo/generator"
)

Expand Down
4 changes: 2 additions & 2 deletions protoc-gen-gogo/plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
# at src/google/protobuf/compiler/plugin.proto
# Also we need to fix an import.
regenerate:
go install github.com/gogo/protobuf/protoc-gen-gogo
protoc --gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. -I=../../protobuf/google/protobuf/compiler/:../../protobuf/ ../../protobuf/google/protobuf/compiler/plugin.proto
go install github.com/tron-us/protobuf/protoc-gen-gogo
protoc --gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/tron-us/protobuf/protoc-gen-gogo/descriptor:. -I=../../protobuf/google/protobuf/compiler/:../../protobuf/ ../../protobuf/google/protobuf/compiler/plugin.proto
2 changes: 1 addition & 1 deletion protoc-gen-gogo/plugin/plugin.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 19 additions & 19 deletions protoc-gen-gogo/testdata/deprecated/deprecated.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protoc-gen-gogo/testdata/deprecated/deprecated.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ syntax = "proto3";
// package deprecated contains only deprecated messages and services.
package deprecated;

option go_package = "github.com/gogo/protobuf/protoc-gen-gogo/testdata/deprecated";
option go_package = "github.com/tron-us/protobuf/protoc-gen-gogo/testdata/deprecated";

option deprecated = true; // file-level deprecation

Expand Down
11 changes: 6 additions & 5 deletions protoc-gen-gogo/testdata/extension_base/extension_base.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ syntax = "proto2";

package extension_base;

option go_package = "github.com/gogo/protobuf/protoc-gen-gogo/testdata/extension_base";
option go_package = "github.com/tron-us/protobuf/protoc-gen-gogo/testdata/extension_base";

message BaseMessage {
optional int32 height = 1;
Expand Down
12 changes: 6 additions & 6 deletions protoc-gen-gogo/testdata/extension_extra/extension_extra.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ syntax = "proto2";

package extension_extra;

option go_package = "github.com/gogo/protobuf/protoc-gen-gogo/testdata/extension_extra";
option go_package = "github.com/tron-us/protobuf/protoc-gen-gogo/testdata/extension_extra";

message ExtraMessage {
optional int32 width = 1;
Expand Down
4 changes: 2 additions & 2 deletions protoc-gen-gogo/testdata/extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import (
"testing"

"github.com/gogo/protobuf/proto"
base "github.com/gogo/protobuf/protoc-gen-gogo/testdata/extension_base"
user "github.com/gogo/protobuf/protoc-gen-gogo/testdata/extension_user"
base "github.com/tron-us/protobuf/protoc-gen-gogo/testdata/extension_base"
user "github.com/tron-us/protobuf/protoc-gen-gogo/testdata/extension_user"
)

func TestSingleFieldExtension(t *testing.T) {
Expand Down
Loading

0 comments on commit 89b25a1

Please sign in to comment.