cmputil

package
v0.0.85-test Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	// Path to the field that has difference separated by period. Array index and key are designated by square brackets.
	// For example, Annotations[12345].Data.Fields[0].ID
	Path  string
	Left  reflect.Value
	Right reflect.Value
}

func (*Diff) String

func (d *Diff) String() string

type DiffReport

type DiffReport []Diff

func (DiffReport) GetDiffsForField

func (r DiffReport) GetDiffsForField(path string) DiffReport

GetDiffsForField returns subset of the diffs which path starts with the provided path

func (DiffReport) String

func (r DiffReport) String() string

type DiffReporter

type DiffReporter struct {
	Diffs DiffReport
	// contains filtered or unexported fields
}

DiffReporter is a simple custom reporter that only records differences detected during comparison. Implements an interface required by cmp.Reporter option

func (*DiffReporter) PopStep

func (r *DiffReporter) PopStep()

func (*DiffReporter) PushStep

func (r *DiffReporter) PushStep(ps cmp.PathStep)

func (*DiffReporter) Report

func (r *DiffReporter) Report(rs cmp.Result)

Jump to

Keyboard shortcuts

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