registry

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package registry provides a way to register options to cmp.Diff.

This is known to be used by:

  • go.chromium.org/luci/testing/truth/should.{Resemble,Match}
  • go.chromium.org/luci/testing/typed.{Diff,Got}

By default this includes:

  • "google.golang.org/protobuf/testing/protocmp".Transform()
  • A direct comparison of protoreflect.Descriptor types. These are documented as being comparable with `==`, but by default `cmp` will recurse into their guts.
  • A direct comparison of reflect.Type interfaces.
  • Functions will compare by their function pointer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCmpOptions

func GetCmpOptions() []cmp.Option

GetCmpOptions gets a copy of the registry at the time it was called.

func RegisterCmpOption

func RegisterCmpOption(opt cmp.Option)

RegisterCmpOption registers an option to the registry.

RegisterCmpOption will panic if the option is nil. This function does not check for duplicate options because I don't have a good way to do that.

Types

This section is empty.

Jump to

Keyboard shortcuts

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