Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: protocolbuffers/protobuf-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.36.3
Choose a base ref
...
head repository: protocolbuffers/protobuf-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.36.4
Choose a head ref
  • 7 commits
  • 150 files changed
  • 2 contributors

Commits on Jan 15, 2025

  1. all: start v1.36.3-devel

    Change-Id: Ic4aec2037f3460ac94d6caf11ece66dfbe4026c0
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/642856
    Reviewed-by: Chressie Himpel <chressie@google.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    stapelberg committed Jan 15, 2025
    Copy the full SHA
    132f042 View commit details
  2. internal_gengo: store raw descriptor in .rodata section

    In Go, []byte literals go into the writable .data (or .noptrdata) section,
    but string literals goes into the read-only .rodata section.
    
    I verified that the contents move from .noptrdata to .rodata:
    
    % (cd internal/reflection_test && \
      go test -c && \
      objdump -s -j .rodata reflection_test.test | grep '0a4669 6e')
     88bfd0 6e7370e8 070a4669 6e746572 6e616c2f  nsp...Finternal/
    
    Change-Id: I87e190b41c02235abea1967eddca2f0262060ed9
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/638135
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Nicolas Hillegeer <aktau@google.com>
    Reviewed-by: Damien Neil <dneil@google.com>
    stapelberg committed Jan 15, 2025
    Copy the full SHA
    cc8d1c2 View commit details
  3. internal_gengo: use unsafe.StringData() to avoid a descriptor copy

    This means our generated code requires Go 1.20+.
    (Go Protobuf currently requires at least Go 1.21.)
    
    Change-Id: Ie65be553bcb5912991d590104ff6b7c6a82b9c38
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/642055
    Reviewed-by: Nicolas Hillegeer <aktau@google.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Damien Neil <dneil@google.com>
    stapelberg committed Jan 15, 2025
    Copy the full SHA
    0c3cc2f View commit details
  4. internal_gengo: switch back from string literal to hex byte slice

    It tourns out that Piper (the revision control system Google uses)
    has a check that requires marking files containing non-UTF8 bytes
    as binary, preventing textual review. We wanted to avoid this issue
    in http://go.dev/cl/638135 and added \r to the escape set for Gerrit,
    but we did not anticipate how strict other systems are in practice.
    
    (I did not notice this issue earlier because the Piper check
    does not trigger when sending a CL for Google-wide testing,
    only when mailing a CL for review.)
    
    It stands to reason that if our revision control and review systems
    do not like string literals with non-UTF8 content, other systems
    probably behave similarly. Hence, let’s revert that part of the change.
    The key part of the change was to switch the type of the embedded
    descriptor bytes from mutable []byte to immutable string.
    
    I verified that the string literal remains in .rodata:
    
    % (cd internal/reflection_test && \
      go test -c && \
      objdump -s -j .rodata reflection_test.test | grep '0a46696e')
     8e9fd0 0a46696e 7465726e 616c2f74 65737470  .Finternal/testp
    
    The bytes printed above only occur once and match the bytes from
    file_internal_testprotos_testeditions_testeditions_hybrid_test_hybrid_proto_rawDesc
    
    Change-Id: I8e1bfe53a5bbf65abe7861a749ace37b215a8e28
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/642857
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Nicolas Hillegeer <aktau@google.com>
    stapelberg committed Jan 15, 2025
    Copy the full SHA
    aee8a9c View commit details

Commits on Jan 16, 2025

  1. reflect/protodesc: fix panic when working with dynamicpb

    Improves on CL 642575 with a few additional checks to make
    sure a panic doesn't occur even under unexpected conditions.
    
    Fixes golang/protobuf#1671
    
    Change-Id: I25bf1cfdf0b35b381cab603f9e06581b3b630d73
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/642975
    Reviewed-by: Damien Neil <dneil@google.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Reviewed-by: Michael Stapelberg <stapelberg@google.com>
    jhump authored and stapelberg committed Jan 16, 2025
    Copy the full SHA
    2005adb View commit details

Commits on Jan 17, 2025

  1. internal_gengo: avoid allocations in rawDescGZIP() accessors

    Use unsafeBytes in rawDescGZIP() as well, which is safe because our
    CompressGZIP() does not write to the byte slice.
    
    Store the result of CompressGZIP as a byte slice so that subsequent
    calls do not cause any more allocations.
    
    In http://go.dev/cl/638135, I asserted that rawDescGZIP() is rarely-used,
    but after rolling out the change Google-internally, affected users made
    me aware of a few programs that heavily access these descriptors.
    
    Change-Id: Ieb5010ddc7b9ac6be88970321ff01a3d29e846bf
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/643276
    Reviewed-by: Chressie Himpel <chressie@google.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    Auto-Submit: Nicolas Hillegeer <aktau@google.com>
    Reviewed-by: Nicolas Hillegeer <aktau@google.com>
    Commit-Queue: Nicolas Hillegeer <aktau@google.com>
    stapelberg authored and gopherbot committed Jan 17, 2025
    Copy the full SHA
    5f93d99 View commit details

Commits on Jan 24, 2025

  1. all: release v1.36.4

    Change-Id: I0982b0714f2f250df0db242d6300cb5f44d999bf
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/643956
    Reviewed-by: Chressie Himpel <chressie@google.com>
    LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
    stapelberg committed Jan 24, 2025
    Copy the full SHA
    259e665 View commit details
Showing with 897 additions and 802 deletions.
  1. +1 −0 cmd/protoc-gen-go/internal_gengo/main.go
  2. +18 −6 cmd/protoc-gen-go/internal_gengo/reflect.go
  3. +6 −6 cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
  4. +1 −1 cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
  5. +6 −6 cmd/protoc-gen-go/testdata/comments/comments.pb.go
  6. +6 −6 cmd/protoc-gen-go/testdata/comments/deprecated.pb.go
  7. +4 −4 cmd/protoc-gen-go/testdata/enumprefix/enumprefix.pb.go
  8. +6 −6 cmd/protoc-gen-go/testdata/extensions/base/base.pb.go
  9. +6 −6 cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go
  10. +6 −6 cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go
  11. +6 −6 cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go
  12. +6 −6 cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
  13. +6 −6 cmd/protoc-gen-go/testdata/import_public/a.pb.go
  14. +6 −6 cmd/protoc-gen-go/testdata/import_public/b.pb.go
  15. +6 −6 cmd/protoc-gen-go/testdata/import_public/c.pb.go
  16. +6 −6 cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
  17. +6 −6 cmd/protoc-gen-go/testdata/import_public/sub/b.pb.go
  18. +6 −6 cmd/protoc-gen-go/testdata/import_public/sub2/a.pb.go
  19. +6 −6 cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go
  20. +6 −6 cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go
  21. +6 −6 cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go
  22. +6 −6 cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go
  23. +6 −6 cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go
  24. +6 −6 cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go
  25. +6 −6 cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go
  26. +6 −6 cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go
  27. +6 −6 cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go
  28. +6 −6 cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go
  29. +6 −6 cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
  30. +4 −4 cmd/protoc-gen-go/testdata/nameclash/test_name_clash_hybrid/test_name_clash_hybrid.pb.go
  31. +4 −4 cmd/protoc-gen-go/testdata/nameclash/test_name_clash_hybrid/test_name_clash_hybrid_protoopaque.pb.go
  32. +4 −4 cmd/protoc-gen-go/testdata/nameclash/test_name_clash_hybrid3/test_name_clash_hybrid3.pb.go
  33. +4 −4 ...rotoc-gen-go/testdata/nameclash/test_name_clash_hybrid3/test_name_clash_hybrid3_protoopaque.pb.go
  34. +4 −4 cmd/protoc-gen-go/testdata/nameclash/test_name_clash_opaque/test_name_clash_opaque.pb.go
  35. +4 −4 cmd/protoc-gen-go/testdata/nameclash/test_name_clash_opaque3/test_name_clash_opaque3.pb.go
  36. +6 −6 cmd/protoc-gen-go/testdata/nameclash/test_name_clash_open/test_name_clash_open.pb.go
  37. +6 −6 cmd/protoc-gen-go/testdata/nameclash/test_name_clash_open3/test_name_clash_open3.pb.go
  38. +6 −6 cmd/protoc-gen-go/testdata/nopackage/nopackage.pb.go
  39. +6 −6 cmd/protoc-gen-go/testdata/proto2/enum.pb.go
  40. +6 −6 cmd/protoc-gen-go/testdata/proto2/fields.pb.go
  41. +6 −6 cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go
  42. +6 −6 cmd/protoc-gen-go/testdata/proto2/proto2.pb.go
  43. +6 −6 cmd/protoc-gen-go/testdata/proto3/enum.pb.go
  44. +6 −6 cmd/protoc-gen-go/testdata/proto3/fields.pb.go
  45. +6 −6 cmd/protoc-gen-go/testdata/protoeditions/enum.pb.go
  46. +6 −6 cmd/protoc-gen-go/testdata/protoeditions/fields.pb.go
  47. +6 −6 cmd/protoc-gen-go/testdata/protoeditions/legacy_enum.pb.go
  48. +6 −6 cmd/protoc-gen-go/testdata/protoeditions/maps_and_delimited.pb.go
  49. +6 −6 cmd/protoc-gen-go/testdata/protoeditions/nested_messages.pb.go
  50. +6 −6 cmd/protoc-gen-go/testdata/retention/options_message.pb.go
  51. +6 −6 cmd/protoc-gen-go/testdata/retention/retention.pb.go
  52. +4 −4 internal/testprotos/annotation/annotation.pb.go
  53. +6 −6 internal/testprotos/benchmarks/micro/micro.pb.go
  54. +6 −6 internal/testprotos/conformance/conformance.pb.go
  55. +6 −6 internal/testprotos/conformance/editions/test_messages_edition2023.pb.go
  56. +6 −6 internal/testprotos/conformance/editionsmigration/test_messages_proto2_editions.pb.go
  57. +6 −6 internal/testprotos/conformance/editionsmigration/test_messages_proto3_editions.pb.go
  58. +6 −6 internal/testprotos/conformance/test_messages_proto2.pb.go
  59. +6 −6 internal/testprotos/conformance/test_messages_proto3.pb.go
  60. +6 −6 internal/testprotos/editionsfuzztest/test2.pb.go
  61. +6 −6 internal/testprotos/editionsfuzztest/test2editions.pb.go
  62. +6 −6 internal/testprotos/editionsfuzztest/test3.pb.go
  63. +6 −6 internal/testprotos/editionsfuzztest/test3editions.pb.go
  64. +6 −6 internal/testprotos/enums/enums.pb.go
  65. +4 −4 internal/testprotos/enums/enums_hybrid/enums.hybrid.pb.go
  66. +4 −4 internal/testprotos/enums/enums_hybrid/enums.hybrid_protoopaque.pb.go
  67. +4 −4 internal/testprotos/enums/enums_opaque/enums.opaque.pb.go
  68. +4 −4 internal/testprotos/examples/ext/extexample.pb.go
  69. +6 −6 internal/testprotos/fieldtrack/fieldtrack.pb.go
  70. +6 −6 internal/testprotos/fuzz/fuzz.pb.go
  71. +6 −6 internal/testprotos/irregular/test.pb.go
  72. +6 −6 internal/testprotos/lazy/lazy_extension_normalized_wire_test.pb.go
  73. +6 −6 internal/testprotos/lazy/lazy_extension_test.pb.go
  74. +4 −4 internal/testprotos/lazy/lazy_hybrid/lazy_tree.hybrid.pb.go
  75. +4 −4 internal/testprotos/lazy/lazy_hybrid/lazy_tree.hybrid_protoopaque.pb.go
  76. +6 −6 internal/testprotos/lazy/lazy_normalized_wire_test.pb.go
  77. +4 −4 internal/testprotos/lazy/lazy_opaque/lazy_tree.opaque.pb.go
  78. +6 −6 internal/testprotos/lazy/lazy_tree.pb.go
  79. +6 −6 internal/testprotos/legacy/legacy.pb.go
  80. +6 −6 internal/testprotos/messageset/messagesetpb/message_set.pb.go
  81. +4 −4 internal/testprotos/messageset/messagesetpb/messagesetpb_hybrid/message_set.hybrid.pb.go
  82. +4 −4 internal/testprotos/messageset/messagesetpb/messagesetpb_hybrid/message_set.hybrid_protoopaque.pb.go
  83. +4 −4 internal/testprotos/messageset/messagesetpb/messagesetpb_opaque/message_set.opaque.pb.go
  84. +6 −6 internal/testprotos/messageset/msetextpb/msetextpb.pb.go
  85. +4 −4 internal/testprotos/messageset/msetextpb/msetextpb_hybrid/msetextpb.hybrid.pb.go
  86. +4 −4 internal/testprotos/messageset/msetextpb/msetextpb_hybrid/msetextpb.hybrid_protoopaque.pb.go
  87. +4 −4 internal/testprotos/messageset/msetextpb/msetextpb_opaque/msetextpb.opaque.pb.go
  88. +6 −6 internal/testprotos/mixed/mixed.pb.go
  89. +6 −6 internal/testprotos/news/news.pb.go
  90. +6 −6 internal/testprotos/order/order.pb.go
  91. +6 −6 internal/testprotos/race/extender/test.pb.go
  92. +6 −6 internal/testprotos/race/message/test.pb.go
  93. +6 −6 internal/testprotos/registry/test.pb.go
  94. +6 −6 internal/testprotos/required/required.pb.go
  95. +4 −4 internal/testprotos/required/required_hybrid/required.hybrid.pb.go
  96. +4 −4 internal/testprotos/required/required_hybrid/required.hybrid_protoopaque.pb.go
  97. +4 −4 internal/testprotos/required/required_opaque/required.opaque.pb.go
  98. +4 −4 internal/testprotos/test/ext.pb.go
  99. +6 −6 internal/testprotos/test/test.pb.go
  100. +6 −6 internal/testprotos/test/test_import.pb.go
  101. +6 −6 internal/testprotos/test/test_public.pb.go
  102. +6 −6 internal/testprotos/test/weak1/test_weak.pb.go
  103. +6 −6 internal/testprotos/test/weak2/test_weak.pb.go
  104. +6 −6 internal/testprotos/test3/test.pb.go
  105. +4 −4 internal/testprotos/test3/test3_hybrid/test.hybrid.pb.go
  106. +4 −4 internal/testprotos/test3/test3_hybrid/test.hybrid_protoopaque.pb.go
  107. +4 −4 internal/testprotos/test3/test3_hybrid/test_import.hybrid.pb.go
  108. +4 −4 internal/testprotos/test3/test3_hybrid/test_import.hybrid_protoopaque.pb.go
  109. +4 −4 internal/testprotos/test3/test3_opaque/test.opaque.pb.go
  110. +4 −4 internal/testprotos/test3/test3_opaque/test_import.opaque.pb.go
  111. +4 −4 internal/testprotos/test3/test_extension.pb.go
  112. +6 −6 internal/testprotos/test3/test_import.pb.go
  113. +6 −6 internal/testprotos/testeditions/test.pb.go
  114. +6 −6 internal/testprotos/testeditions/test_extension.pb.go
  115. +6 −6 internal/testprotos/testeditions/test_extension2.pb.go
  116. +6 −6 internal/testprotos/testeditions/test_import.pb.go
  117. +4 −4 internal/testprotos/testeditions/testeditions_hybrid/test.hybrid.pb.go
  118. +4 −4 internal/testprotos/testeditions/testeditions_hybrid/test.hybrid_protoopaque.pb.go
  119. +4 −4 internal/testprotos/testeditions/testeditions_hybrid/test_extension.hybrid.pb.go
  120. +4 −4 internal/testprotos/testeditions/testeditions_hybrid/test_extension.hybrid_protoopaque.pb.go
  121. +4 −4 internal/testprotos/testeditions/testeditions_hybrid/test_extension2.hybrid.pb.go
  122. +4 −4 internal/testprotos/testeditions/testeditions_hybrid/test_extension2.hybrid_protoopaque.pb.go
  123. +4 −4 internal/testprotos/testeditions/testeditions_hybrid/test_import.hybrid.pb.go
  124. +4 −4 internal/testprotos/testeditions/testeditions_hybrid/test_import.hybrid_protoopaque.pb.go
  125. +4 −4 internal/testprotos/testeditions/testeditions_opaque/test.opaque.pb.go
  126. +4 −4 internal/testprotos/testeditions/testeditions_opaque/test_extension.opaque.pb.go
  127. +4 −4 internal/testprotos/testeditions/testeditions_opaque/test_extension2.opaque.pb.go
  128. +4 −4 internal/testprotos/testeditions/testeditions_opaque/test_import.opaque.pb.go
  129. +6 −6 internal/testprotos/textpb2/test.pb.go
  130. +6 −6 internal/testprotos/textpb3/test.pb.go
  131. +6 −6 internal/testprotos/textpbeditions/test2.pb.go
  132. +4 −4 internal/testprotos/textpbeditions/textpbeditions_hybrid/test2.hybrid.pb.go
  133. +4 −4 internal/testprotos/textpbeditions/textpbeditions_hybrid/test2.hybrid_protoopaque.pb.go
  134. +4 −4 internal/testprotos/textpbeditions/textpbeditions_opaque/test2.opaque.pb.go
  135. +1 −1 internal/version/version.go
  136. +21 −4 reflect/protodesc/editions.go
  137. +85 −20 reflect/protodesc/editions_test.go
  138. +6 −6 types/descriptorpb/descriptor.pb.go
  139. +6 −6 types/gofeaturespb/go_features.pb.go
  140. +6 −6 types/known/anypb/any.pb.go
  141. +6 −6 types/known/apipb/api.pb.go
  142. +6 −6 types/known/durationpb/duration.pb.go
  143. +6 −6 types/known/emptypb/empty.pb.go
  144. +6 −6 types/known/fieldmaskpb/field_mask.pb.go
  145. +6 −6 types/known/sourcecontextpb/source_context.pb.go
  146. +6 −6 types/known/structpb/struct.pb.go
  147. +6 −6 types/known/timestamppb/timestamp.pb.go
  148. +6 −6 types/known/typepb/type.pb.go
  149. +6 −6 types/known/wrapperspb/wrappers.pb.go
  150. +6 −6 types/pluginpb/plugin.pb.go
1 change: 1 addition & 0 deletions cmd/protoc-gen-go/internal_gengo/main.go
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ const (
syncPackage = protogen.GoImportPath("sync")
timePackage = protogen.GoImportPath("time")
utf8Package = protogen.GoImportPath("unicode/utf8")
unsafePackage = protogen.GoImportPath("unsafe")
)

// Protobuf library dependencies.
24 changes: 18 additions & 6 deletions cmd/protoc-gen-go/internal_gengo/reflect.go
Original file line number Diff line number Diff line change
@@ -187,7 +187,10 @@ func genReflectFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f
g.P("out := ", protoimplPackage.Ident("TypeBuilder"), "{")
g.P("File: ", protoimplPackage.Ident("DescBuilder"), "{")
g.P("GoPackagePath: ", reflectPackage.Ident("TypeOf"), "(x{}).PkgPath(),")
g.P("RawDescriptor: ", rawDescVarName(f), ",")
// Avoid a copy of the descriptor. This means modification of the
// RawDescriptor byte slice will crash the program. But generated
// RawDescriptors are never supposed to be modified anyway.
g.P("RawDescriptor: ", unsafeBytesRawDesc(g, f), ",")
g.P("NumEnums: ", len(f.allEnums), ",")
g.P("NumMessages: ", len(f.allMessages), ",")
g.P("NumExtensions: ", len(f.allExtensions), ",")
@@ -208,7 +211,6 @@ func genReflectFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f
g.P(f.GoDescriptorIdent, " = out.File")

// Set inputs to nil to allow GC to reclaim resources.
g.P(rawDescVarName(f), " = nil")
g.P(goTypesVarName(f), " = nil")
g.P(depIdxsVarName(f), " = nil")
g.P("}")
@@ -243,7 +245,7 @@ func genFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileI
return
}

g.P("var ", rawDescVarName(f), " = []byte{")
g.P("var ", rawDescVarName(f), " = string([]byte{")
for len(b) > 0 {
n := 16
if n > len(b) {
@@ -258,28 +260,38 @@ func genFileDescriptor(gen *protogen.Plugin, g *protogen.GeneratedFile, f *fileI

b = b[n:]
}
g.P("}")
g.P("})")
g.P()

if f.needRawDesc {
onceVar := rawDescVarName(f) + "Once"
dataVar := rawDescVarName(f) + "Data"
g.P("var (")
g.P(onceVar, " ", syncPackage.Ident("Once"))
g.P(dataVar, " = ", rawDescVarName(f))
g.P(dataVar, " []byte")
g.P(")")
g.P()

g.P("func ", rawDescVarName(f), "GZIP() []byte {")
g.P(onceVar, ".Do(func() {")
g.P(dataVar, " = ", protoimplPackage.Ident("X"), ".CompressGZIP(", dataVar, ")")
g.P(dataVar, " = ", protoimplPackage.Ident("X"), ".CompressGZIP(", unsafeBytesRawDesc(g, f), ")")
g.P("})")
g.P("return ", dataVar)
g.P("}")
g.P()
}
}

// unsafeBytesRawDesc returns an inlined version of [strs.UnsafeBytes]
// (gencode cannot depend on internal/strs). Modification of this byte
// slice will crash the program.
func unsafeBytesRawDesc(g *protogen.GeneratedFile, f *fileInfo) string {
return fmt.Sprintf("%s(%s(%[3]s), len(%[3]s))",
g.QualifiedGoIdent(unsafePackage.Ident("Slice")),
g.QualifiedGoIdent(unsafePackage.Ident("StringData")),
rawDescVarName(f))
}

func genEnumReflectMethods(g *protogen.GeneratedFile, f *fileInfo, e *enumInfo) {
idx := f.allEnumsByPtr[e]
typesVar := enumTypesVarName(f)
12 changes: 6 additions & 6 deletions cmd/protoc-gen-go/testdata/annotations/annotations.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
annotation:{path:5 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:512 end:531} annotation:{path:5 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:548 end:595} annotation:{path:4 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:1954 end:1976} annotation:{path:4 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:2053 end:2073} annotation:{path:4 path:0 path:2 path:1 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:2256 end:2266} annotation:{path:4 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3437 end:3460} annotation:{path:4 path:0 path:2 path:1 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3603 end:3607} annotation:{path:4 path:0 path:2 path:1 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3770 end:3774 semantic:SET}
annotation:{path:5 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:529 end:548} annotation:{path:5 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:565 end:612} annotation:{path:4 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:1971 end:1993} annotation:{path:4 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:2070 end:2090} annotation:{path:4 path:0 path:2 path:1 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:2273 end:2283} annotation:{path:4 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3454 end:3477} annotation:{path:4 path:0 path:2 path:1 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3620 end:3624} annotation:{path:4 path:0 path:2 path:1 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3787 end:3791 semantic:SET}
12 changes: 6 additions & 6 deletions cmd/protoc-gen-go/testdata/comments/comments.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions cmd/protoc-gen-go/testdata/comments/deprecated.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions cmd/protoc-gen-go/testdata/enumprefix/enumprefix.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading