comments.proto 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. // COMMENT: package goproto.protoc.comments;
  6. package goproto.protoc.comments;
  7. option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/comments";
  8. // COMMENT: Enum1.Leading
  9. enum Enum1 {
  10. // COMMENT: FOO.Leading
  11. FOO = 0; // COMMENT: FOO.InlineTrailing
  12. // COMMENT: BAR.Leading
  13. BAR = 1;
  14. // COMMENT: BAR.Trailing1
  15. // COMMENT: BAR.Trailing2
  16. // COMMENT: Enum1.EndBody
  17. }
  18. // COMMENT: Message1.Leading
  19. message Message1 {
  20. // COMMENT: Message1A.Leading
  21. message Message1A {
  22. } // COMMENT: Message1A.Trailing
  23. // COMMENT: Message1B
  24. message Message1B {
  25. }
  26. // COMMENT: Field1A.Leading
  27. optional string Field1A = 1; // COMMENT: Field1A.Trailing
  28. // COMMENT: Oneof1A.Leading
  29. oneof Oneof1a {
  30. // COMMENT: Oneof1AField1.Leading
  31. string Oneof1AField1 = 2; // COMMENT: Oneof1AField1.Trailing
  32. } // COMMENT: Oneof1A.Trailing
  33. extensions 100 to max;
  34. } // COMMENT: Message1.Trailing
  35. // COMMENT: Extend
  36. extend Message1 {
  37. // COMMENT: Extension.Leading
  38. optional Message1 extension = 100; // COMMENT: Extension.Trailing
  39. }
  40. // COMMENT: Message2
  41. message Message2 {
  42. // COMMENT: Message2A
  43. message Message2A {
  44. }
  45. // COMMENT: Message2B
  46. message Message2B {
  47. }
  48. }