1URL="https://raw.githubusercontent.com/google/protobuf/master/src/google/protobuf/" 2 3update: 4 go install github.com/gogo/protobuf/gogoreplace 5 6 (cd ./google/protobuf && rm descriptor.proto; wget ${URL}/descriptor.proto) 7 # gogoprotobuf requires users to import gogo.proto which imports descriptor.proto 8 # The descriptor.proto is only compatible with proto3 just because of the reserved keyword. 9 # We remove it to stay compatible with previous versions of protoc before proto3 10 gogoreplace 'reserved 38;' '//reserved 38;' ./google/protobuf/descriptor.proto 11 12 (cd ./google/protobuf/compiler && rm plugin.proto; wget ${URL}/compiler/plugin.proto) 13 14 15 (cd ./google/protobuf && rm any.proto; wget ${URL}/any.proto) 16 gogoreplace 'go_package = "github.com/golang/protobuf/ptypes/any";' 'go_package = "types";' ./google/protobuf/any.proto 17 (cd ./google/protobuf && rm empty.proto; wget ${URL}/empty.proto) 18 gogoreplace 'go_package = "github.com/golang/protobuf/ptypes/empty";' 'go_package = "types";' ./google/protobuf/empty.proto 19 (cd ./google/protobuf && rm timestamp.proto; wget ${URL}/timestamp.proto) 20 gogoreplace 'go_package = "github.com/golang/protobuf/ptypes/timestamp";' 'go_package = "types";' ./google/protobuf/timestamp.proto 21 (cd ./google/protobuf && rm duration.proto; wget ${URL}/duration.proto) 22 gogoreplace 'go_package = "github.com/golang/protobuf/ptypes/duration";' 'go_package = "types";' ./google/protobuf/duration.proto 23 (cd ./google/protobuf && rm struct.proto; wget ${URL}/struct.proto) 24 gogoreplace 'go_package = "github.com/golang/protobuf/ptypes/struct;structpb";' 'go_package = "types";' ./google/protobuf/struct.proto 25 (cd ./google/protobuf && rm wrappers.proto; wget ${URL}/wrappers.proto) 26 gogoreplace 'go_package = "github.com/golang/protobuf/ptypes/wrappers";' 'go_package = "types";' ./google/protobuf/wrappers.proto 27 (cd ./google/protobuf && rm field_mask.proto; wget ${URL}/field_mask.proto) 28 gogoreplace 'option csharp_namespace = "Google.Protobuf.WellKnownTypes";' 'option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "types";' ./google/protobuf/field_mask.proto 29 30 31