Skip to content

Commit d18af0d

Browse files
committed
protoc-gen-go: expand import_public test files
Convert all the import_public protos to proto2 to allow testing more features. Add usage of groups, extensions, and default values.
1 parent d3de96c commit d18af0d

File tree

9 files changed

+210
-66
lines changed

9 files changed

+210
-66
lines changed

protoc-gen-go/testdata/import_public/a.pb.go

Lines changed: 12 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protoc-gen-go/testdata/import_public/a.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3030
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131

32-
syntax = "proto3";
32+
syntax = "proto2";
3333

3434
package goproto.test.import_public;
3535

@@ -39,7 +39,7 @@ import public "import_public/sub/a.proto"; // Different Go package.
3939
import public "import_public/b.proto"; // Same Go package.
4040

4141
message Public {
42-
goproto.test.import_public.sub.M m = 1;
43-
goproto.test.import_public.sub.E e = 2;
44-
Local local = 3;
42+
optional goproto.test.import_public.sub.M m = 1;
43+
optional goproto.test.import_public.sub.E e = 2;
44+
optional Local local = 3;
4545
}

protoc-gen-go/testdata/import_public/b.pb.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protoc-gen-go/testdata/import_public/b.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3030
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3131

32-
syntax = "proto3";
32+
syntax = "proto2";
3333

3434
package goproto.test.import_public;
3535

@@ -38,6 +38,6 @@ option go_package = "github.com/golang/protobuf/protoc-gen-go/testdata/import_pu
3838
import "import_public/sub/a.proto";
3939

4040
message Local {
41-
goproto.test.import_public.sub.M m = 1;
42-
goproto.test.import_public.sub.E e = 2;
41+
optional goproto.test.import_public.sub.M m = 1;
42+
optional goproto.test.import_public.sub.E e = 2;
4343
}

0 commit comments

Comments
 (0)