enum.proto 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. syntax = "proto2";
  5. package goproto.protoc.proto2;
  6. option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/proto2";
  7. // EnumType1 comment.
  8. enum EnumType1 {
  9. // EnumType1_ONE comment.
  10. ONE = 1;
  11. // EnumType1_TWO comment.
  12. TWO = 2;
  13. }
  14. enum EnumType2 {
  15. option allow_alias = true;
  16. duplicate1 = 1;
  17. duplicate2 = 1;
  18. reserved "RESERVED1";
  19. reserved "RESERVED2";
  20. reserved 2, 3;
  21. }
  22. message EnumContainerMessage1 {
  23. optional EnumType2 default_duplicate1 = 1 [default=duplicate1];
  24. optional EnumType2 default_duplicate2 = 2 [default=duplicate2];
  25. // NestedEnumType1A comment.
  26. enum NestedEnumType1A {
  27. // NestedEnumType1A_VALUE comment.
  28. NESTED_1A_VALUE = 0;
  29. }
  30. enum NestedEnumType1B {
  31. NESTED_1B_VALUE = 0;
  32. }
  33. message EnumContainerMessage2 {
  34. // NestedEnumType2A comment.
  35. enum NestedEnumType2A {
  36. // NestedEnumType2A_VALUE comment.
  37. NESTED_2A_VALUE = 0;
  38. }
  39. enum NestedEnumType2B {
  40. NESTED_2B_VALUE = 0;
  41. }
  42. }
  43. }