protoreflectcmp

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2021 License: Apache-2.0, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package protoreflectcmp provides testing facilites for using the cmp package with protoreflect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transform

func Transform(thisLibraryOpt ...Option) cmp.Option

Transform returns a cmp.Option that will make protoreflect.List instances comparable to slices of proto messages.

The slice type used for comparison should be a slice of some non-interface type. cmp.Equal(<some protoreflect.List instance>, []proto.Message{&mypb.X{}}) will not work, while cmp.Equal(<some protoreflect.List instance>, []*mypb.X{&mypb.X{}}) will.

Types

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option configures the Transform function.

func IgnoreElementType

func IgnoreElementType() Option

If specified, ignores differences between the element types of two lists. This may be needed if comparing []proto.Message{} to protoreflect.List.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL