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.30.0
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.31.0
Choose a head ref
  • 10 commits
  • 34 files changed
  • 8 contributors

Commits on Mar 16, 2023

  1. all: start v1.30.0-devel

    Change-Id: I36d043a08b60783360dfca21f100b697fe7e3e8d
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/476836
    Reviewed-by: Michael Stapelberg <stapelberg@google.com>
    lfolger committed Mar 16, 2023
    Copy the full SHA
    808c664 View commit details

Commits on Apr 26, 2023

  1. all: update protobuf release version to fix macOS tests

    Update to a protobuf version that contains a fix for
    protocolbuffers/protobuf#12173
    (macOS build error).
    
    Set "CC=clang" when building the protobuf repo on macOS,
    which fixes build errors on my machine (macOS 13.3.1, M1).
    
    Change-Id: Id8abb054479454b7ccbded5a6fa4d74f3d3c236d
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/489315
    Run-TryBot: Damien Neil <dneil@google.com>
    Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
    Reviewed-by: Lasse Folger <lassefolger@google.com>
    neild committed Apr 26, 2023
    Copy the full SHA
    736947c View commit details

Commits on Apr 28, 2023

  1. types/dynamicpb: add NewTypes

    Add a function to construct a dynamic type registry from a
    protoregistry.Files. The NewTypes constructor takes a concrete
    Files to permit future improvements based on changes to Files.
    (For example, we might add a Files.FindExtensionByNumber
    method, which Types could take advantage of.)
    
    Fixes golang/protobuf#1216
    
    Change-Id: I61edba0a94528829d40f69fad773ccb5912859e0
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/489316
    Run-TryBot: Damien Neil <dneil@google.com>
    Reviewed-by: Lasse Folger <lassefolger@google.com>
    Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
    neild authored and stapelberg committed Apr 28, 2023
    Copy the full SHA
    1bca6d9 View commit details

Commits on May 1, 2023

  1. encoding: add MarshalAppend to protojson and prototext

    Adds MarshalAppend methods to allow for byte slices to be reused.
    Copies signature from the binary encoding.
    
    Small changes to internal json and text libraries to use strconv
    AppendInt and AppendUint for number encoding.
    
    Change-Id: Ife7c8979c1c153a0a0bf9b70b296b8158d38dffc
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/489615
    Reviewed-by: Edward McFarlane <emcfarlane000@gmail.com>
    Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
    Reviewed-by: Lasse Folger <lassefolger@google.com>
    Reviewed-by: Damien Neil <dneil@google.com>
    emcfarlane authored and neild committed May 1, 2023
    Copy the full SHA
    05cbe34 View commit details
  2. compiler/protogen: add Semantic.SET to setter annotations

    Provide an API to add the GeneratedCodeInfo.Annotation.Semantic enum to
    annotations.
    
    Change-Id: I92ab30619a94a117679a0eb16d8cb5b3a1352586
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/489795
    Reviewed-by: Lasse Folger <lassefolger@google.com>
    Reviewed-by: Damien Neil <dneil@google.com>
    schroederc authored and neild committed May 1, 2023
    Copy the full SHA
    cf06b0c View commit details

Commits on May 8, 2023

  1. encoding/protodelim: If UnmarshalFrom gets a bufio.Reader, try to reu…

    …se its buffer instead of creating a new one
    
    When unmarshalling many messages, this reduces the amount of memory allocated and saves CPU time.
    
    Change-Id: I440b8b223319ba2ed31ce559c125b1d640d5880c
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/491596
    Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
    Reviewed-by: Lasse Folger <lassefolger@google.com>
    Reviewed-by: Damien Neil <dneil@google.com>
    vanja-pejovic authored and neild committed May 8, 2023
    Copy the full SHA
    b8fc770 View commit details

Commits on May 25, 2023

  1. internal/order: fix sorting of synthetic oneofs to be deterministic

    Before this change, synthetic oneofs were ignored in the inOneof() helper
    function, but not in the remainder of the LegacyFieldOrder function.
    
    Change-Id: Ia60e5244ae1000e98bbba9dd26f1d1583337fab4
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/497935
    Reviewed-by: Damien Neil <dneil@google.com>
    Reviewed-by: Lasse Folger <lassefolger@google.com>
    Reviewed-by: Cassondra Foesch <cfoesch@gmail.com>
    stapelberg committed May 25, 2023
    Copy the full SHA
    cc524c9 View commit details

Commits on Jun 6, 2023

  1. proto: store the size of tag to avoid multiple calculations

    Change-Id: I001c2c6996e92d69234431f3463b5558840da948
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/500695
    Reviewed-by: Lasse Folger <lassefolger@google.com>
    Reviewed-by: Michael Stapelberg <stapelberg@google.com>
    chenyahui authored and stapelberg committed Jun 6, 2023
    Copy the full SHA
    fc47fdd View commit details

Commits on Jun 26, 2023

  1. encoding/protodelim: fix handling of io.EOF

    Before this change, when encountering an io.EOF after reading at least
    one byte, the zero value byte was — incorrectly — appended to sizeBuf,
    and the io.EOF was ignored, resulting in a complete varint (0 has no
    continuation bit), which in turn resulted in incorrect unmarshalling.
    
    Change-Id: If06d45039d998eaddf91d0864814bb31d4cb7ae0
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/505555
    Reviewed-by: Lasse Folger <lassefolger@google.com>
    Reviewed-by: Damien Neil <dneil@google.com>
    stapelberg committed Jun 26, 2023
    Copy the full SHA
    59a8581 View commit details
  2. all: release v1.31.0

    Change-Id: Ic67237749015f22a8657b65ad7250a6f95b742b4
    Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/506155
    Reviewed-by: Michael Stapelberg <stapelberg@google.com>
    lfolger committed Jun 26, 2023
    Copy the full SHA
    68463f0 View commit details
Showing with 3,013 additions and 863 deletions.
  1. +40 −11 cmd/protoc-gen-go/annotation_test.go
  2. +4 −1 cmd/protoc-gen-go/internal_gengo/main.go
  3. +36 −11 cmd/protoc-gen-go/testdata/annotations/annotations.pb.go
  4. +1 −1 cmd/protoc-gen-go/testdata/annotations/annotations.pb.go.meta
  5. +4 −0 cmd/protoc-gen-go/testdata/annotations/annotations.proto
  6. +45 −11 compiler/protogen/protogen.go
  7. +72 −0 compiler/protogen/protogen_test.go
  8. +23 −3 encoding/protodelim/protodelim.go
  9. +137 −15 encoding/protodelim/protodelim_test.go
  10. +10 −4 encoding/protojson/encode.go
  11. +41 −0 encoding/protojson/encode_test.go
  12. +10 −4 encoding/prototext/encode.go
  13. +42 −0 encoding/prototext/encode_test.go
  14. +10 −2 integration_test.go
  15. +6 −4 internal/encoding/json/encode.go
  16. +3 −3 internal/encoding/json/encode_test.go
  17. +6 −4 internal/encoding/text/encode.go
  18. +4 −4 internal/encoding/text/encode_test.go
  19. +48 −0 internal/genid/descriptor_gen.go
  20. +6 −0 internal/genid/type_gen.go
  21. +1 −1 internal/order/order.go
  22. +2 −2 internal/order/order_test.go
  23. +1,285 −268 internal/testprotos/conformance/test_messages_proto2.pb.go
  24. +1 −1 internal/version/version.go
  25. +7 −3 proto/size.go
  26. +27 −0 reflect/protoreflect/source_gen.go
  27. +633 −378 types/descriptorpb/descriptor.pb.go
  28. +177 −0 types/dynamicpb/types.go
  29. +174 −0 types/dynamicpb/types_test.go
  30. +35 −35 types/known/anypb/any.pb.go
  31. +1 −1 types/known/apipb/api.pb.go
  32. +1 −1 types/known/structpb/struct.pb.go
  33. +1 −1 types/known/timestamppb/timestamp.pb.go
  34. +120 −94 types/known/typepb/type.pb.go
51 changes: 40 additions & 11 deletions cmd/protoc-gen-go/annotation_test.go
Original file line number Diff line number Diff line change
@@ -9,9 +9,11 @@ import (
"io/ioutil"
"testing"

"github.com/google/go-cmp/cmp"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/internal/genid"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/testing/protocmp"

"google.golang.org/protobuf/types/descriptorpb"
)
@@ -33,22 +35,48 @@ func TestAnnotations(t *testing.T) {
wantInfo := &descriptorpb.GeneratedCodeInfo{}
for _, want := range []struct {
prefix, text, suffix string
path []int32
annotation *descriptorpb.GeneratedCodeInfo_Annotation
}{{
"type ", "AnnotationsTestEnum", " int32",
[]int32{int32(genid.FileDescriptorProto_EnumType_field_number), 0},
&descriptorpb.GeneratedCodeInfo_Annotation{
Path: []int32{int32(genid.FileDescriptorProto_EnumType_field_number), 0},
},
}, {
"\t", "AnnotationsTestEnum_ANNOTATIONS_TEST_ENUM_VALUE", " AnnotationsTestEnum = 0",
[]int32{int32(genid.FileDescriptorProto_EnumType_field_number), 0, int32(genid.EnumDescriptorProto_Value_field_number), 0},
&descriptorpb.GeneratedCodeInfo_Annotation{
Path: []int32{int32(genid.FileDescriptorProto_EnumType_field_number), 0, int32(genid.EnumDescriptorProto_Value_field_number), 0},
},
}, {
"type ", "AnnotationsTestMessage", " struct {",
[]int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0},
&descriptorpb.GeneratedCodeInfo_Annotation{
Path: []int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0},
},
}, {
"\t", "AnnotationsTestField", " ",
[]int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0, int32(genid.DescriptorProto_Field_field_number), 0},
&descriptorpb.GeneratedCodeInfo_Annotation{
Path: []int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0, int32(genid.DescriptorProto_Field_field_number), 0},
},
}, {
"\t", "XXX_weak_M", " ",
&descriptorpb.GeneratedCodeInfo_Annotation{
Path: []int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0, int32(genid.DescriptorProto_Field_field_number), 1},
},
}, {
"func (x *AnnotationsTestMessage) ", "GetAnnotationsTestField", "() string {",
[]int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0, int32(genid.DescriptorProto_Field_field_number), 0},
&descriptorpb.GeneratedCodeInfo_Annotation{
Path: []int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0, int32(genid.DescriptorProto_Field_field_number), 0},
},
}, {
"func (x *AnnotationsTestMessage) ", "GetM", "() proto.Message {",
&descriptorpb.GeneratedCodeInfo_Annotation{
Path: []int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0, int32(genid.DescriptorProto_Field_field_number), 1},
},
}, {
"func (x *AnnotationsTestMessage) ", "SetM", "(v proto.Message) {",
&descriptorpb.GeneratedCodeInfo_Annotation{
Path: []int32{int32(genid.FileDescriptorProto_MessageType_field_number), 0, int32(genid.DescriptorProto_Field_field_number), 1},
Semantic: descriptorpb.GeneratedCodeInfo_Annotation_SET.Enum(),
},
}} {
s := want.prefix + want.text + want.suffix
pos := bytes.Index(sourceFile, []byte(s))
@@ -58,14 +86,15 @@ func TestAnnotations(t *testing.T) {
}
begin := pos + len(want.prefix)
end := begin + len(want.text)
wantInfo.Annotation = append(wantInfo.Annotation, &descriptorpb.GeneratedCodeInfo_Annotation{
Path: want.path,
a := &descriptorpb.GeneratedCodeInfo_Annotation{
Begin: proto.Int32(int32(begin)),
End: proto.Int32(int32(end)),
SourceFile: proto.String("cmd/protoc-gen-go/testdata/annotations/annotations.proto"),
})
}
proto.Merge(a, want.annotation)
wantInfo.Annotation = append(wantInfo.Annotation, a)
}
if !proto.Equal(gotInfo, wantInfo) {
t.Errorf("unexpected annotations for annotations.proto; got:\n%v\nwant:\n%v", gotInfo, wantInfo)
if diff := cmp.Diff(wantInfo, gotInfo, protocmp.Transform()); diff != "" {
t.Fatalf("unexpected annotations for annotations.proto (-want +got):\n%s", diff)
}
}
5 changes: 4 additions & 1 deletion cmd/protoc-gen-go/internal_gengo/main.go
Original file line number Diff line number Diff line change
@@ -614,7 +614,10 @@ func genMessageSetterMethods(g *protogen.GeneratedFile, f *fileInfo, m *messageI

genNoInterfacePragma(g, m.isTracked)

g.Annotate(m.GoIdent.GoName+".Set"+field.GoName, field.Location)
g.AnnotateSymbol(m.GoIdent.GoName+".Set"+field.GoName, protogen.Annotation{
Location: field.Location,
Semantic: descriptorpb.GeneratedCodeInfo_Annotation_SET.Enum(),
})
leadingComments := appendDeprecationSuffix("",
field.Desc.ParentFile(),
field.Desc.Options().(*descriptorpb.FieldOptions).GetDeprecated())
47 changes: 36 additions & 11 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:470 end:489} annotation:{path:5 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:506 end:553} annotation:{path:4 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:1912 end:1934} annotation:{path:4 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:2058 end:2078} annotation:{path:4 path:0 path:2 path:0 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3225 end:3248}
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:2136 end:2156} 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:3397 end:3420} annotation:{path:4 path:0 path:2 path:1 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3563 end:3567} annotation:{path:4 path:0 path:2 path:1 source_file:"cmd/protoc-gen-go/testdata/annotations/annotations.proto" begin:3730 end:3734 semantic:SET}
4 changes: 4 additions & 0 deletions cmd/protoc-gen-go/testdata/annotations/annotations.proto
Original file line number Diff line number Diff line change
@@ -6,10 +6,14 @@ syntax = "proto2";

package goproto.protoc.annotations;

import weak "cmd/protoc-gen-go/testdata/imports/fmt/m.proto";

option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/annotations";

message AnnotationsTestMessage {
optional string AnnotationsTestField = 1;

optional fmt.M m = 2 [weak = true];
}

enum AnnotationsTestEnum {
56 changes: 45 additions & 11 deletions compiler/protogen/protogen.go
Original file line number Diff line number Diff line change
@@ -920,7 +920,7 @@ type GeneratedFile struct {
packageNames map[GoImportPath]GoPackageName
usedPackageNames map[GoPackageName]bool
manualImports map[GoImportPath]bool
annotations map[string][]Location
annotations map[string][]Annotation
}

// NewGeneratedFile creates a new generated file with the given filename
@@ -933,7 +933,7 @@ func (gen *Plugin) NewGeneratedFile(filename string, goImportPath GoImportPath)
packageNames: make(map[GoImportPath]GoPackageName),
usedPackageNames: make(map[GoPackageName]bool),
manualImports: make(map[GoImportPath]bool),
annotations: make(map[string][]Location),
annotations: make(map[string][]Annotation),
}

// All predeclared identifiers in Go are already used.
@@ -1012,8 +1012,32 @@ func (g *GeneratedFile) Unskip() {
// The symbol may refer to a type, constant, variable, function, method, or
// struct field. The "T.sel" syntax is used to identify the method or field
// 'sel' on type 'T'.
//
// Deprecated: Use the AnnotateSymbol method instead.
func (g *GeneratedFile) Annotate(symbol string, loc Location) {
g.annotations[symbol] = append(g.annotations[symbol], loc)
g.AnnotateSymbol(symbol, Annotation{Location: loc})
}

// An Annotation provides semantic detail for a generated proto element.
//
// See the google.protobuf.GeneratedCodeInfo.Annotation documentation in
// descriptor.proto for details.
type Annotation struct {
// Location is the source .proto file for the element.
Location Location

// Semantic is the symbol's effect on the element in the original .proto file.
Semantic *descriptorpb.GeneratedCodeInfo_Annotation_Semantic
}

// AnnotateSymbol associates a symbol in a generated Go file with a location
// in a source .proto file and a semantic type.
//
// The symbol may refer to a type, constant, variable, function, method, or
// struct field. The "T.sel" syntax is used to identify the method or field
// 'sel' on type 'T'.
func (g *GeneratedFile) AnnotateSymbol(symbol string, info Annotation) {
g.annotations[symbol] = append(g.annotations[symbol], info)
}

// Content returns the contents of the generated file.
@@ -1106,25 +1130,24 @@ func (g *GeneratedFile) Content() ([]byte, error) {
return out.Bytes(), nil
}

// metaFile returns the contents of the file's metadata file, which is a
// text formatted string of the google.protobuf.GeneratedCodeInfo.
func (g *GeneratedFile) metaFile(content []byte) (string, error) {
func (g *GeneratedFile) generatedCodeInfo(content []byte) (*descriptorpb.GeneratedCodeInfo, error) {
fset := token.NewFileSet()
astFile, err := parser.ParseFile(fset, "", content, 0)
if err != nil {
return "", err
return nil, err
}
info := &descriptorpb.GeneratedCodeInfo{}

seenAnnotations := make(map[string]bool)
annotate := func(s string, ident *ast.Ident) {
seenAnnotations[s] = true
for _, loc := range g.annotations[s] {
for _, a := range g.annotations[s] {
info.Annotation = append(info.Annotation, &descriptorpb.GeneratedCodeInfo_Annotation{
SourceFile: proto.String(loc.SourceFile),
Path: loc.Path,
SourceFile: proto.String(a.Location.SourceFile),
Path: a.Location.Path,
Begin: proto.Int32(int32(fset.Position(ident.Pos()).Offset)),
End: proto.Int32(int32(fset.Position(ident.End()).Offset)),
Semantic: a.Semantic,
})
}
}
@@ -1171,10 +1194,21 @@ func (g *GeneratedFile) metaFile(content []byte) (string, error) {
}
for a := range g.annotations {
if !seenAnnotations[a] {
return "", fmt.Errorf("%v: no symbol matching annotation %q", g.filename, a)
return nil, fmt.Errorf("%v: no symbol matching annotation %q", g.filename, a)
}
}

return info, nil
}

// metaFile returns the contents of the file's metadata file, which is a
// text formatted string of the google.protobuf.GeneratedCodeInfo.
func (g *GeneratedFile) metaFile(content []byte) (string, error) {
info, err := g.generatedCodeInfo(content)
if err != nil {
return "", err
}

b, err := prototext.Marshal(info)
if err != nil {
return "", err
72 changes: 72 additions & 0 deletions compiler/protogen/protogen_test.go
Original file line number Diff line number Diff line change
@@ -11,8 +11,10 @@ import (

"github.com/google/go-cmp/cmp"

"google.golang.org/protobuf/internal/genid"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/testing/protocmp"

"google.golang.org/protobuf/types/descriptorpb"
"google.golang.org/protobuf/types/pluginpb"
@@ -344,3 +346,73 @@ var _ = bar.X
t.Fatalf("content mismatch (-want +got):\n%s", diff)
}
}

func TestAnnotations(t *testing.T) {
gen, err := Options{}.New(&pluginpb.CodeGeneratorRequest{})
if err != nil {
t.Fatal(err)
}
loc := Location{SourceFile: "foo.go"}
g := gen.NewGeneratedFile("foo.go", "golang.org/x/foo")

g.P("package foo")
g.P()

structName := "S"
fieldName := "Field"

messageLoc := loc.appendPath(genid.FileDescriptorProto_MessageType_field_number, 1)
fieldLoc := messageLoc.appendPath(genid.DescriptorProto_Field_field_number, 1)

g.Annotate(structName, messageLoc) // use deprecated version to test existing usages
g.P("type ", structName, " struct {")
g.AnnotateSymbol(structName+"."+fieldName, Annotation{Location: fieldLoc})
g.P(fieldName, " string")
g.P("}")
g.P()

g.AnnotateSymbol(fmt.Sprintf("%s.Set%s", structName, fieldName), Annotation{
Location: fieldLoc,
Semantic: descriptorpb.GeneratedCodeInfo_Annotation_SET.Enum(),
})
g.P("func (m *", structName, ") Set", fieldName, "(x string) {")
g.P("m.", fieldName, " = x")
g.P("}")
g.P()

want := &descriptorpb.GeneratedCodeInfo{
Annotation: []*descriptorpb.GeneratedCodeInfo_Annotation{
{ // S
SourceFile: proto.String("foo.go"),
Path: []int32{4, 1}, // message S
Begin: proto.Int32(18),
End: proto.Int32(19),
},
{ // S.F
SourceFile: proto.String("foo.go"),
Path: []int32{4, 1, 2, 1},
Begin: proto.Int32(30),
End: proto.Int32(35),
},
{ // SetF
SourceFile: proto.String("foo.go"),
Path: []int32{4, 1, 2, 1},
Begin: proto.Int32(58),
End: proto.Int32(66),
Semantic: descriptorpb.GeneratedCodeInfo_Annotation_SET.Enum(),
},
},
}

content, err := g.Content()
if err != nil {
t.Fatalf("g.Content() = %v", err)
}
got, err := g.generatedCodeInfo(content)
if err != nil {
t.Fatalf("g.generatedCodeInfo(...) = %v", err)
}
if diff := cmp.Diff(want, got, protocmp.Transform()); diff != "" {
t.Fatalf("GeneratedCodeInfo mismatch (-want +got):\n%s", diff)
}
}
Loading