From d24a30858e23ace7aeee306e2ce652aba8021631 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Thu, 24 May 2018 00:10:35 -0400 Subject: [PATCH] no gogo proto --- Makefile | 9 ++++----- common/types.pb.go | 31 ++++++++++++++----------------- common/types.proto | 7 ------- 3 files changed, 18 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index efef4599..3c79e680 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,11 @@ GOTOOLS = \ github.com/golang/dep/cmd/dep \ - github.com/gogo/protobuf/protoc-gen-gogo \ - github.com/gogo/protobuf/gogoproto \ + github.com/golang/protobuf/protoc-gen-go \ github.com/square/certstrap # github.com/alecthomas/gometalinter.v2 \ -GOTOOLS_CHECK = dep gometalinter.v2 protoc protoc-gen-gogo -INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf +GOTOOLS_CHECK = dep gometalinter.v2 protoc protoc-gen-go +INCLUDE = -I=. -I=${GOPATH}/src all: check get_vendor_deps protoc grpc_dbserver build test install metalinter @@ -19,7 +18,7 @@ protoc: ## If you get the following error, ## "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory" ## See https://stackoverflow.com/a/25518702 - protoc $(INCLUDE) --gogo_out=plugins=grpc:. common/*.proto + protoc $(INCLUDE) --go_out=plugins=grpc:. common/*.proto @echo "--> adding nolint declarations to protobuf generated files" @awk '/package common/ { print "//nolint: gas"; print; next }1' common/types.pb.go > common/types.pb.go.new @mv common/types.pb.go.new common/types.pb.go diff --git a/common/types.pb.go b/common/types.pb.go index 047b7aee..f6645602 100644 --- a/common/types.pb.go +++ b/common/types.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. +// Code generated by protoc-gen-go. DO NOT EDIT. // source: common/types.proto /* @@ -14,10 +14,9 @@ It has these top-level messages: //nolint: gas package common -import proto "github.com/gogo/protobuf/proto" +import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import _ "github.com/gogo/protobuf/gogoproto" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -28,7 +27,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // Define these here for compatibility but use tmlibs/common.KVPair. type KVPair struct { @@ -39,7 +38,7 @@ type KVPair struct { func (m *KVPair) Reset() { *m = KVPair{} } func (m *KVPair) String() string { return proto.CompactTextString(m) } func (*KVPair) ProtoMessage() {} -func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{0} } +func (*KVPair) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *KVPair) GetKey() []byte { if m != nil { @@ -58,13 +57,13 @@ func (m *KVPair) GetValue() []byte { // Define these here for compatibility but use tmlibs/common.KI64Pair. type KI64Pair struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` + Value int64 `protobuf:"varint,2,opt,name=value" json:"value,omitempty"` } func (m *KI64Pair) Reset() { *m = KI64Pair{} } func (m *KI64Pair) String() string { return proto.CompactTextString(m) } func (*KI64Pair) ProtoMessage() {} -func (*KI64Pair) Descriptor() ([]byte, []int) { return fileDescriptorTypes, []int{1} } +func (*KI64Pair) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *KI64Pair) GetKey() []byte { if m != nil { @@ -85,17 +84,15 @@ func init() { proto.RegisterType((*KI64Pair)(nil), "common.KI64Pair") } -func init() { proto.RegisterFile("common/types.proto", fileDescriptorTypes) } +func init() { proto.RegisterFile("common/types.proto", fileDescriptor0) } -var fileDescriptorTypes = []byte{ - // 137 bytes of a gzipped FileDescriptorProto +var fileDescriptor0 = []byte{ + // 107 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, - 0x83, 0x88, 0x49, 0xe9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, - 0xe7, 0xa7, 0xe7, 0xeb, 0x83, 0xa5, 0x93, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, 0x68, - 0x53, 0x32, 0xe0, 0x62, 0xf3, 0x0e, 0x0b, 0x48, 0xcc, 0x2c, 0x12, 0x12, 0xe0, 0x62, 0xce, 0x4e, - 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0x02, 0x31, 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x12, - 0x73, 0x4a, 0x53, 0x25, 0x98, 0xc0, 0x62, 0x10, 0x8e, 0x92, 0x11, 0x17, 0x87, 0xb7, 0xa7, 0x99, - 0x09, 0x31, 0x7a, 0x98, 0xa1, 0x7a, 0x92, 0xd8, 0xc0, 0x96, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, - 0xff, 0x5c, 0xb8, 0x46, 0xc5, 0xb9, 0x00, 0x00, 0x00, + 0x83, 0x88, 0x29, 0x19, 0x70, 0xb1, 0x79, 0x87, 0x05, 0x24, 0x66, 0x16, 0x09, 0x09, 0x70, 0x31, + 0x67, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0x81, 0x98, 0x42, 0x22, 0x5c, 0xac, + 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, 0x60, 0x31, 0x08, 0x47, 0xc9, 0x88, 0x8b, 0xc3, 0xdb, + 0xd3, 0xcc, 0x84, 0x18, 0x3d, 0xcc, 0x50, 0x3d, 0x49, 0x6c, 0x60, 0x4b, 0x8d, 0x01, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xd8, 0xf1, 0xc3, 0x8c, 0x8a, 0x00, 0x00, 0x00, } diff --git a/common/types.proto b/common/types.proto index 94abcccc..8406fcfd 100644 --- a/common/types.proto +++ b/common/types.proto @@ -1,13 +1,6 @@ syntax = "proto3"; package common; -// For more information on gogo.proto, see: -// https://github.com/gogo/protobuf/blob/master/extensions.md -// NOTE: Try really hard not to use custom types, -// it's often complicated, broken, nor not worth it. -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - - //---------------------------------------- // Abstract types