Skip to content

protoc-gen-go: generated Equal method #1238

Open
@glenjamin

Description

@glenjamin

Is your feature request related to a problem? Please describe.
Although https://godoc.org/google.golang.org/protobuf/testing/protocmp#Transform provides a custom handler for go-cmp, it has to be explicitly specified every time a comparison is performed

Describe the solution you'd like
It would be preferrable if no custom transformer was required to compare protobuf structs.

This can be achieved by implementing the Equal method in the generated code, which would be used by go-cmp automatically.

• Types that have an Equal method may use that method to determine equality. This allows package authors to determine the equality operation for the types that they define. 

Describe alternatives you've considered
I've also suggested that go-cmp allow global options google/go-cmp#241

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    generator-proto-optioninvolves generators respecting a proto option to control generated source output

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions