equality

package
v0.0.0-...-506879c Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterField

func FilterField(typ interface{}, field string, opt cmp.Option) cmp.Option

FilterField return a new option that only apply specified option to specific struct field.

func IgnoreFakeClientPopulatedFields

func IgnoreFakeClientPopulatedFields() cmp.Option

IgnoreFakeClientPopulatedFields is an option to ignore fields populated by fakeK8sClient for a comparison. Use this when comparing k8s objects in test cases. These fields are ignored: TypeMeta and ObjectMeta.ResourceVersion

func IgnoreLeftHandUnset

func IgnoreLeftHandUnset(typ interface{}, fields ...string) cmp.Option

IgnoreLeftHandUnset is an option that ignores struct fields that are unset on the left hand side of a comparison. Note:

  1. for map and slices, only nil value is considered to be unset, non-nil but empty is not considered as unset.
  2. for struct pointers, nil value is considered to be unset

func IgnoreOtherFields

func IgnoreOtherFields(typ interface{}, fields ...string) cmp.Option

IgnoreOtherFields is option that only compare specific structures fields.

func IgnoreStringSliceOrder

func IgnoreStringSliceOrder() cmp.Option

IgnoreStringSliceOrder is option that compare string slices without order.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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