Skip to content

Commit

Permalink
test proto gogo#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Hessam Alipour authored and Hessam Alipour committed May 3, 2023
1 parent b94ea24 commit d544fa2
Show file tree
Hide file tree
Showing 264 changed files with 759 additions and 759 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Checkout branch
uses: actions/checkout@v1
with:
path: gopath/src/github.com/gogo/protobuf
path: gopath/src/github.com/hessamalipour/protobuf
fetch-depth: 5

- name: Setup go
Expand All @@ -43,4 +43,4 @@ jobs:

- name: Diff check
if: matrix.protobuf_version == '3.14.0' && matrix.go_version == '1.15.x'
run: (! git status --porcelain | read || (git status; git diff; exit 1))
run: (! git status --porcelain | read || (git status; git diff; exit 1))
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Protocol Buffers for Go with Gadgets
#
# Copyright (c) 2013, The GoGo Authors. All rights reserved.
# http://github.com/gogo/protobuf
# http://github.com/hessamalipour/protobuf
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -30,8 +30,8 @@ GO_VERSION:=$(shell go version)
BENCHLIST?=all

# Skip known issues from purego tests
# https://github.com/gogo/protobuf/issues/447
# https://github.com/gogo/protobuf/issues/448
# https://github.com/hessamalipour/protobuf/issues/447
# https://github.com/hessamalipour/protobuf/issues/448
SKIPISSUE:="/jsonpb|/test/casttype/|/test/oneof/combos/"

.PHONY: nuke regenerate tests clean install gofmt vet contributors
Expand Down Expand Up @@ -159,7 +159,7 @@ errcheck:

drone:
sudo apt-get install protobuf-compiler
(cd $(GOPATH)/src/github.com/gogo/protobuf && make buildserverall)
(cd $(GOPATH)/src/github.com/hessamalipour/protobuf && make buildserverall)

testall:
go get -u github.com/golang/protobuf/proto
Expand All @@ -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/hessamalipour/protobuf/protoc-gen-gogo
endif

purego:
Expand Down
16 changes: 8 additions & 8 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Protocol Buffers for Go with Gadgets

GoGoProtobuf http://github.com/gogo/protobuf extends
GoGoProtobuf http://github.com/hessamalipour/protobuf extends
GoProtobuf http://github.com/golang/protobuf

Copyright (c) 2013, The GoGo Authors. All rights reserved.
Expand Down Expand Up @@ -55,7 +55,7 @@ See the note at the bottom of this file for details.
There are no insertion points in the plugin.

GoGoProtobuf provides extensions for protocol buffers and GoProtobuf
see http://github.com/gogo/protobuf/gogoproto/doc.go
see http://github.com/hessamalipour/protobuf/gogoproto/doc.go

## Using protocol buffers with Go ##

Expand All @@ -79,7 +79,7 @@ each source `.proto` file is associated with a single Go package. The
name and import path for this package is specified with the `go_package`
proto option:

option go_package = "github.com/gogo/protobuf/types";
option go_package = "github.com/hessamalipour/protobuf/types";

The protocol buffer compiler will attempt to derive a package name and
import path if a `go_package` option is not present, but it is
Expand All @@ -99,7 +99,7 @@ be:
- Relative to the import path:

protoc --gogo_out=. inputs/x.proto
# writes ./github.com/gogo/protobuf/p/x.pb.go
# writes ./github.com/hessamalipour/protobuf/p/x.pb.go

(This can work well with `--gogo_out=$GOPATH`.)

Expand All @@ -116,13 +116,13 @@ version.

If you are using any gogo.proto extensions you will need to specify the
proto_path to include the descriptor.proto and gogo.proto.
gogo.proto is located in github.com/gogo/protobuf/gogoproto
gogo.proto is located in github.com/hessamalipour/protobuf/gogoproto
This should be fine, since your import is the same.
descriptor.proto is located in either github.com/gogo/protobuf/protobuf
descriptor.proto is located in either github.com/hessamalipour/protobuf/protobuf
or code.google.com/p/protobuf/trunk/src/
Its import is google/protobuf/descriptor.proto so it might need some help.

protoc --gogo_out=. -I=.:github.com/gogo/protobuf/protobuf *.proto
protoc --gogo_out=. -I=.:github.com/hessamalipour/protobuf/protobuf *.proto

==========

Expand Down Expand Up @@ -195,7 +195,7 @@ To create and play with a Test object from the example package,
import (
"log"

"github.com/gogo/protobuf/proto"
"github.com/hessamalipour/protobuf/proto"
"path/to/example"
)

Expand Down
44 changes: 22 additions & 22 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<img src="https://img.youtube.com/vi/HTIltI0NuNg/maxres1.jpg" alt="Watch the video" width="480" border="10" />
</a>

[![Build Status](https://github.com/gogo/protobuf/workflows/Continuous%20Integration/badge.svg)](https://github.com/gogo/protobuf/actions)
[![GoDoc](https://godoc.org/github.com/gogo/protobuf?status.svg)](http://godoc.org/github.com/gogo/protobuf)
[![Build Status](https://github.com/hessamalipour/protobuf/workflows/Continuous%20Integration/badge.svg)](https://github.com/hessamalipour/protobuf/actions)
[![GoDoc](https://godoc.org/github.com/hessamalipour/protobuf?status.svg)](http://godoc.org/github.com/hessamalipour/protobuf)

gogoprotobuf is a fork of <a href="https://github.com/golang/protobuf">golang/protobuf</a> with extra code generation features.

Expand All @@ -21,11 +21,11 @@ This code generation is used to achieve:
- other serialization formats

Keeping track of how up to date gogoprotobuf is relative to golang/protobuf is done in this
<a href="https://github.com/gogo/protobuf/issues/191">issue</a>
<a href="https://github.com/hessamalipour/protobuf/issues/191">issue</a>

## Release v1.3.0

The project has updated to release v1.3.0. Check out the release notes <a href="https://github.com/gogo/protobuf/releases/tag/v1.3.0">here</a>.
The project has updated to release v1.3.0. Check out the release notes <a href="https://github.com/hessamalipour/protobuf/releases/tag/v1.3.0">here</a>.

With this new release comes a new internal library version. This means any newly generated *pb.go files generated with the v1.3.0 library will not be compatible with the old library version (v1.2.1). However, current *pb.go files (generated with v1.2.1) should still work with the new library.

Expand Down Expand Up @@ -111,13 +111,13 @@ Most versions from 2.3.1 should not give any problems, but 2.6.1, 3.0.2 and 3.14

Install the protoc-gen-gofast binary

go get github.com/gogo/protobuf/protoc-gen-gofast
go get github.com/hessamalipour/protobuf/protoc-gen-gofast

Use it to generate faster marshaling and unmarshaling go code for your protocol buffers.

protoc --gofast_out=. myproto.proto

This does not allow you to use any of the other gogoprotobuf [extensions](https://github.com/gogo/protobuf/blob/master/extensions.md).
This does not allow you to use any of the other gogoprotobuf [extensions](https://github.com/hessamalipour/protobuf/blob/master/extensions.md).

### More Speed and more generated code

Expand All @@ -132,24 +132,24 @@ Other binaries are also included:

Installing any of these binaries is easy. Simply run:

go get github.com/gogo/protobuf/proto
go get github.com/gogo/protobuf/{binary}
go get github.com/gogo/protobuf/gogoproto
go get github.com/hessamalipour/protobuf/proto
go get github.com/hessamalipour/protobuf/{binary}
go get github.com/hessamalipour/protobuf/gogoproto

These binaries allow you to use gogoprotobuf [extensions](https://github.com/gogo/protobuf/blob/master/extensions.md). You can also use your own binary.
These binaries allow you to use gogoprotobuf [extensions](https://github.com/hessamalipour/protobuf/blob/master/extensions.md). You can also use your own binary.

To generate the code, you also need to set the include path properly.

protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --{binary}_out=. myproto.proto
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/hessamalipour/protobuf/protobuf --{binary}_out=. myproto.proto

To use proto files from "google/protobuf" you need to add additional args to protoc.

protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf/protobuf --{binary}_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:. \
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/hessamalipour/protobuf/protobuf --{binary}_out=\
Mgoogle/protobuf/any.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/struct.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/timestamp.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/wrappers.proto=github.com/hessamalipour/protobuf/types:. \
myproto.proto

Note that in the protoc command, {binary} does not contain the initial prefix of "protoc-gen".
Expand All @@ -159,14 +159,14 @@ Note that in the protoc command, {binary} does not contain the initial prefix of
Customizing the fields of the messages to be the fields that you actually want to use removes the need to copy between the structs you use and structs you use to serialize.
gogoprotobuf also offers more serialization formats and generation of tests and even more methods.

Please visit the [extensions](https://github.com/gogo/protobuf/blob/master/extensions.md) page for more documentation.
Please visit the [extensions](https://github.com/hessamalipour/protobuf/blob/master/extensions.md) page for more documentation.

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/gogo/protobuf/gogoproto
go get github.com/hessamalipour/protobuf/proto
go get github.com/hessamalipour/protobuf/jsonpb
go get github.com/hessamalipour/protobuf/protoc-gen-gogo
go get github.com/hessamalipour/protobuf/gogoproto

## GRPC

Expand Down
6 changes: 3 additions & 3 deletions bench.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ For a comparison run:

followed by [benchcmp](http://code.google.com/p/go/source/browse/misc/benchcmp benchcmp) on the resulting files:

$GOROOT/misc/benchcmp $GOPATH/src/github.com/gogo/protobuf/test/mixbench/marshal.txt $GOPATH/src/github.com/gogo/protobuf/test/mixbench/marshaler.txt
$GOROOT/misc/benchcmp $GOPATH/src/github.com/gogo/protobuf/test/mixbench/unmarshal.txt $GOPATH/src/github.com/gogo/protobuf/test/mixbench/unmarshaler.txt
$GOROOT/misc/benchcmp $GOPATH/src/github.com/hessamalipour/protobuf/test/mixbench/marshal.txt $GOPATH/src/github.com/hessamalipour/protobuf/test/mixbench/marshaler.txt
$GOROOT/misc/benchcmp $GOPATH/src/github.com/hessamalipour/protobuf/test/mixbench/unmarshal.txt $GOPATH/src/github.com/hessamalipour/protobuf/test/mixbench/unmarshaler.txt

Benchmarks ran on Revision: 11c56be39364

Expand Down Expand Up @@ -187,4 +187,4 @@ Memory 8 GB 1067 MHz DDR3
<tr><td>BenchmarkTimerProtoUnmarshal</td><td>61.12</td><td>190.34</td><td>3.11x</td></tr>
<tr><td>BenchmarkMyExtendableProtoUnmarshal</td><td>9.90</td><td>36.71</td><td>3.71x</td></tr>
<tr><td>BenchmarkOtherExtenableProtoUnmarshal</td><td>21.90</td><td>52.13</td><td>2.38x</td></tr>
</table>
</table>
14 changes: 7 additions & 7 deletions conformance/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ test:
./test.sh $(PROTOBUF_ROOT)

regenerate:
protoc-min-version --version="3.0.0" --proto_path=$(GOPATH)/src:$(GOPATH)/src/github.com/gogo/protobuf/protobuf:. --gogo_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,\
Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types\
protoc-min-version --version="3.0.0" --proto_path=$(GOPATH)/src:$(GOPATH)/src/github.com/hessamalipour/protobuf/protobuf:. --gogo_out=\
Mgoogle/protobuf/any.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/duration.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/struct.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/timestamp.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/wrappers.proto=github.com/hessamalipour/protobuf/types,\
Mgoogle/protobuf/field_mask.proto=github.com/hessamalipour/protobuf/types\
:. ./internal/conformance_proto/conformance.proto
16 changes: 8 additions & 8 deletions custom_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Check [t.go](test/t.go) for a full example
`Warning about customtype: It is your responsibility to test all cases of your marshaling, unmarshaling and size methods implemented for your custom type.`

Issues with customtype include:
* <a href="https://github.com/gogo/protobuf/issues/199">A Bytes method is not allowed.<a/>
* <a href="https://github.com/gogo/protobuf/issues/132">Defining a customtype as a fake proto message is broken.</a>
* <a href="https://github.com/gogo/protobuf/issues/147">proto.Clone is broken.</a>
* <a href="https://github.com/gogo/protobuf/issues/125">Using a proto message as a customtype is not allowed.</a>
* <a href="https://github.com/gogo/protobuf/issues/200">cusomtype of type map can not UnmarshalText</a>
* <a href="https://github.com/gogo/protobuf/issues/201">customtype of type struct cannot jsonpb unmarshal</a>
* <a href="https://github.com/gogo/protobuf/issues/477">Customtype field does not get a generated 'getter' method</a>
* <a href="https://github.com/gogo/protobuf/issues/478">Repeated customtype fields generate slices without pointer to the custom type </a>
* <a href="https://github.com/hessamalipour/protobuf/issues/199">A Bytes method is not allowed.<a/>
* <a href="https://github.com/hessamalipour/protobuf/issues/132">Defining a customtype as a fake proto message is broken.</a>
* <a href="https://github.com/hessamalipour/protobuf/issues/147">proto.Clone is broken.</a>
* <a href="https://github.com/hessamalipour/protobuf/issues/125">Using a proto message as a customtype is not allowed.</a>
* <a href="https://github.com/hessamalipour/protobuf/issues/200">cusomtype of type map can not UnmarshalText</a>
* <a href="https://github.com/hessamalipour/protobuf/issues/201">customtype of type struct cannot jsonpb unmarshal</a>
* <a href="https://github.com/hessamalipour/protobuf/issues/477">Customtype field does not get a generated 'getter' method</a>
* <a href="https://github.com/hessamalipour/protobuf/issues/478">Repeated customtype fields generate slices without pointer to the custom type </a>
Loading

0 comments on commit d544fa2

Please sign in to comment.